Version (26)
For client applications, the Version operation (B_VERSION) returns the local MicroKernel Engine 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 MicroKernel Engine version on that server. For server-based applications, the Version operation returns the server-based MicroKernel Engine version and revision numbers.
Parameters
Op Code
Pos Block
Data Buf
Data Buf Len
Key Buffer
Key Number
Sent
Returned
Prerequisites
Either the MicroKernel Engine 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
54
.)
3
To retrieve the version number of a server-based MicroKernel Engine, you must specify either a valid position block for an opened file on that server or a valid path name in the key buffer.
Result
If you have both a workstation MicroKernel Engine and client Requester configured for access and the Version operation is successful, the operation returns the version information for the workstation MicroKernel Engine, the client Requester, and the server-based MicroKernel Engine.
Specify a 15-byte data buffer and data buffer length.
If both the client Requester and the workstation MicroKernel Engine 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 MicroKernel Engine or Requester, according to the format shown in Table
54
. The fifth byte of each block identifies each MicroKernel Engine or Requester.
Table 54
Version Block
Element
Length (Bytes)
Description
Version Number
2
PSQL version number.
Revision Number
2
PSQL revision number.
Requester or Engine Type
1
Type of engine or requester; one of the following:
•
B (0x42) for the Btrieve engine
•
9 (0x39) for the Workgroup database engine or Linux or OS X database server using Workgroup authentication mode
•
D (0x44) for DOS workstation
•
N (0x4E) for client Requester
•
T (0x54) for Windows server engine
•
U (0x55) for Linux or OS X 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 MicroKernel Engine returns a nonzero status code.
Positioning
The Version operation has no effect on positioning.