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

Login/Logout (78)

Chapter contents

The Login/Logout operation (B_LOGIN/B_LOGOUT) allows a user to specify his/her user credentials and obtain authentication and authorization tokens from the database engine. This operation also allows the user to reset his/her login credentials so that they must be entered again to gain access to the database.

Parameters

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

     

Returned
           

Prerequisites
Login Procedure
  1. Set the Operation Code to 78.
  2. Set the key number to 0.
  3. Place the server name, database name, user ID, and password in the key buffer in the form of a database URI. (In Pervasive PSQL Programmer's Guide, see Database URIs .)
Logout Procedure
  1. Set the Operation Code to 78.
  2. Set the key number to 1.
  3. Place the server name, database name, user ID, and password in the key buffer in the form of a database URI. (In Pervasive PSQL Programmer's Guide, see Database URIs .)

Result

If the Login or Logout operation is successful, the database engine returns status 0; otherwise, one of the following status codes may be returned:

1

Invalid operation

172

Database name not found

3103

Unknown server

Notes

The combined length of the database URI must be less than 255 bytes. This is due to the maximum size of the key buffer.

The Login operation has a performance cost. You should not code applications to login and logout on every file. Instead, login once to a database at the beginning of a session, then logout when the database work is complete.

Positioning

The Login/Logout operation has no effect on any file currency information.


Chapter contents
Book contents

Prev topic: Insert Extended (40)
Next topic: Open (0)