PreviousBtrieve API Guide (9.1 revision 1) Next

Version (26)

Show this topic in Library frames

For client applications, the Version operation (B_VERSION) returns the local MicroKernel 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 version on that server. For server-based applications, the Version operation returns the server-based MicroKernel version and revision numbers.

Parameters

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

   

   
Returned
   

   

Prerequisites

Either the MicroKernel 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 MicroKernel, 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 MicroKernel and client Requester configured for access and the Version operation is successful, the operation returns the version information for the workstation MicroKernel, the client Requester, and the server-based MicroKernel.

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

If both the client Requester and the workstation MicroKernel 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 or Requester, according to the format shown in Table 2-40. The fifth byte of each block identifies each MicroKernel or Requester.

Table 2-40 Version Block 
Element
Length (in Bytes)
Description
Version Number
 2
Btrieve version number.
Revision Number
 2
Btrieve 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 for Windows NT/2000 v8.10, 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 returns a nonzero status code.

Positioning

The Version operation has no effect on positioning.


Chapter contents
Publication contents

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