Download UserManual for SQL/XML-IMDB
Transcript
API Overview Error Management Most of the API functions return an error code reporting about the success or failure of the function. If the function succeeds the returned value is zero, non zero-values signal an error. Most of the returned error codes refer the parsing and execution of SQL statements. Therefore, always check the returned error status of the SQL executing API functions. Every instance of an IMDb object contains an internal variable, holding the latest error code. The next occurring error overwrites this with a new value. Be sure to query the error code always immediately after the error causing function. The VBA (ActiveX) version of the database throws IMDB exceptions. The NET version throws IMDB exceptions (IMDbException). Functions with possible table lock conflicts throwing a “table read/write lock” exception: ExecSql ExecPrepared Update Delete Insert* *Note: The Insert function returns 1 (true) or the value of a COUNTER type column (if defined) after the call was successful. Either 0 (c++) is returned or an exception is thrown (VBA, NET) when the function failed. A detailed description of the error can be retrieved, by calling one of the following functions below immediately after the error causing function. GetLastErrorNumber () Returns the error number of the latest occurring error. TCHAR *GetErrorDescription (int errCode) Returns the pointer to a string, describing the error. (Not available for VBA and NET) In shared memory scenarios it might be possible that another process my put a lock on a table which is never released due to a sudden process dead. To avoid a dead-lock on that (shared) table you can use these function to resolve the conflict. TCHAR * ClearAllLocksOnTable (TCHAR *tableName) The function clears any read and write lock on local or shared memory tables. QuiLogic SQL/XML-IMDB 38