UltraLite User's Guide
C++ API Reference
ULConnection class
bool LastCodeOK ( )
Checks the most recent SQLCODE and returns true if the code represents a warning or success. The function returns false if the most recent SQLCODE represents an error.
This method provides a convenient way of checking for the success or potential failure of operations. You can use GetSQLCode to obtain the numerical value.
SQLCODE is reset by any subsequent UltraLite database operation, including those on other connections.
true (1) if the previous SQLCode was zero or a warning.
false (0) if the previous SQLCode was an error.
The following example checks that an attempt to Open a connection succeeded:
ULConnection conn; conn.Open(); if( conn.LastCodeOK() ){ printf( "Connected to the database.\n" ); };