|
Checks the consistency of a database.
Header file: CATALOG.HRequires: W3DBAV75.DLL or higher version
|
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.
|
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.
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); }
PvStart()
PvConnectServer()
PvGetDbNamesData()
PvGetDbName()
PvFreeDbNamesData()
PvDisconnect()
PvStop()
|
Chapter contents
Prev topic: PvAlterUserPassword()
|