PreviousDTI Programmer's Guide (v10) Next

PvCheckDbInfo()

Chapter contents

Checks the consistency of a database.

Header file: CATALOG.H
Requires: W3DBAV75.DLL or higher version

Syntax

BTI_SINT PvCheckDbInfo( 
   BTI_LONG       hConnection, 
   BTI_CHAR_PTR   dbName, 
   BTI_ULONG      checkFlags); 

Arguments

In
hConnection
Connection handle that identifies the server. Connection handles are obtained with the PvConnectServer() function.
In
dbName
Name of an existing named database. A list of all named databases for a particular server is obtained with the PvGetDbNamesData() function. A single named database from the resulting list can be obtained with the PvGetDbName() function.
In
checkFlags
Reserved. The function checks for all database flags.

Return Values

P_OK
The operation was successful.
P_E_INVALID_HANDLE
Connection handle that identifies the server is invalid.
P_E_NULL_PTR
The function was called with a null pointer.
P_E_ACCESS_RIGHT
Insufficient access rights to call the function.
P_E_NOT_EXIST
Named database specified in dbName does not exist.
P_E_FAIL
A general failure occurred.

Remarks

If the database is consistent, then the return value for this function is P_OK. If the database is not consistent or if the function call fails, then the return value is one of the error codes listed above.

Example

BTI_WORD res; // returned value from function call 
BTI_CHAR_PTR dbName;    // database name 
BTI_ULONG        checkFlags;     // database flags 
BTI_LONG        hConnection;    // connection handle 
BTI_LONG         reserved;  
  // reserved value for PvStart() and PvStop() 
  // Initialize variables. 
dbName   = "demodata"; 
  // The name of the database is demodata 
checkFlags = 0xFFFFFFFF;   // Checks all flags 
hConnection = P_LOCAL_DB_CONNECTION;     
  // Set the connection handle to local connection 
  // P_LOCAL_DB_CONNECTION is defined in config.h 
reserved = 0; 
 // Start a DTI session before making any DTI calls. 
res = PvStart (reserved); 
if (res == P_OK) 
 { 
    // DTI session started successfully. 
    // You can now make multiple DTI calls here. 
          
         res = PvCheckDbInfo (hConnection, 
                              dbName, 
                              checkFlags); 
         if (res == P_OK) 
           { 
       // Database is consistent. 
} 
           else 
            { 
       // Put your code here to handle the error code 
       // returned from PvCheckDbInfo ().    
} 
      // Close DTI session. 
             Res = PvStop (&reserved); 
}              

See Also

PvStart()
PvConnectServer()
PvGetDbNamesData()
PvGetDbName()
PvFreeDbNamesData()
PvDisconnect()
PvStop()


Chapter contents
Book contents

Prev topic: PvAlterUserPassword()
Next topic: PvCloseDatabase()