PreviousBtrieve API Guide (v9 SP2 (9.5) revision 1) Next

Version (26)

Chapter contents

For client applications, the Version operation (B_VERSION) returns the local transactional interface version and the Requester version, if applicable. If a client application opens a file on a server or specifies a server file path name in the Key Buffer, the Version operation also returns the transactional interface version on that server. For server-based applications, the Version operation returns the server-based transactional interface version and revision numbers.

Parameters

 
Op Code
Pos Block
Data Buf
Data Buf Len
Key Buffer
Key Number
Sent

   

   
Returned
   

   

Prerequisites

Either the transactional interface or the Requester must be loaded before you can issue a Version operation.

Procedure
  1. Set the Operation Code to 26.
  2. Set the Data Buffer Length to at least 15. (For more information, see Table 2-40.)
  3. To retrieve the version number of a server-based transactional interface, you must specify either a valid Position Block for an opened file on that server or a valid pathname in the Key Buffer.
Result

If you have both a workstation transactional interface and client Requester configured for access and the Version operation is successful, the operation returns the version information for the workstation transactional interface, the client Requester, and the server-based transactional interface.

Specify a 15-byte Data Buffer and Data Buffer Length.

If both the client Requester and the workstation transactional interface are loaded and you specify only a 5-byte Data Buffer and Data Buffer Length, the operation returns only the client Requester's version information.

If you specify only a 10-byte Data Buffer and Data Buffer Length, the operation returns the client Requester and the local workstation engine.

If you specify a 15-byte Data Buffer and Data Buffer Length, the operation returns the client Requester, the local workstation engine, and the server engine (if applicable).

In the Data Buffer, the Version operation returns a 5-byte Version Block for each transactional interface or Requester, according to the format shown in Table 2-40. The fifth byte of each block identifies each transactional interface or Requester.

Table 2-40 Version Block 
Element
Length (in Bytes)
Description
Version Number
 2
Pervasive PSQL version number.
Revision Number
 2
Pervasive PSQL revision number.
Requester or Engine Type
 1
Type of engine or requester; one of the following:
  • 9 (0x39) for 32-bit Windows workstation/workgroup engine or Linux server using Workgroup authentication mode
  • D (0x44) for DOS workstation
  • N (0x4E) for client Requester
  • S (0x53) for NetWare server
  • T (0x54) for 32-bit Windows server engine
  • U (0x55) for Linux server using PAM or BTPASSWD authentication

For example, if you are running Pervasive.SQL v8.10 for Windows, the Version operation returns the following hexadecimal values in the Data Buffer:

08 00 0A 00 54 

After converting these values to decimal, the version number is 8 and the revision number is 10. If the Version operation is unsuccessful, the transactional interface returns a nonzero status code.

Positioning

The Version operation has no effect on positioning.


Chapter contents
Book contents

Prev topic: Update Chunk (53)
Next topic: Quick Reference of Btrieve Operations