Contents Index IsOpen method LastFetchOK method pdf/preface.pdf

UltraLite User's Guide
  C++ API Reference
    ULConnection class

LastCodeOK method


Prototype 

bool  LastCodeOK ( )

Description 

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.

Returns 

true (1) if the previous SQLCode was zero or a warning.

false (0) if the previous SQLCode was an error.

Example 

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" );
};
See also 

GetSQLCode method


Contents Index IsOpen method LastFetchOK method pdf/preface.pdf