oosqlIsHandleNull



This routine provides a way for the programmer to check if a Handle is null. The functions in ooSQLite that return handles will return a null handle on error. A null handle should never be used as an argument to any function.

Arguments: The single argument is:
handle The handle to check.
Return value: Returns true if the handle is null, false if it is not null.
Remarks: The oosqlBackupInit , oosqlOpen , oosqlPrepare and several other functions return handles. These handles will be null on error. If the programmer is not completely adverse to using object methods, theisNull() method can be invoked on a handle to test for null, rather than use theoosqlIsHandleNull()function. E.g
-- The following code snippet:
if handle~isNull then ...
-- is equivalent to this snippet using the oosqlIsHandleNull() function:
if oosqlIsHandleNull(handle) then ...
Details This function does not access any of the SQLite APIs. It is specific to ooSQLite.
Example: This example opens a database connection and checks to be sure the returned handle is not null:
dbConn = oosqlOpen('contacts.rdbx')
if oosqlIsHandleNull(dbConn) then do
-- handle the error ...
end