Programming Guide : 5. Working with a Database : Handling Database Errors : How You Can Use the ErrorStatus Attribute
 
Share this page                  
How You Can Use the ErrorStatus Attribute
The ErrorStatus attribute of the BitmapObject and StringObject system classes is set to a nonzero value if an error occurs when you explicitly set the FileHandle or DBHandle attribute of either object. The following are ways to do this in a program:
In an assignment statement
In the target list of a statement, such as a select statement
By passing the attribute by reference to a procedure
Indirectly setting either attribute by executing one of the methods associated with BitmapObjects or StringObjects (InsertIntoDB, UpdateInDB, DeleteFromDB) does not affect the ErrorStatus attribute. For example, assume that your application uses the InsertIntoDB method to add bitmap images to the database. This method constructs a DBHandle for each image that it inserts into the database. If an error occurs and the DBHandle is incorrectly set, the ErrorStatus attribute is not set; instead, an error message is generated, the ErrorNumber and DBMSError attributes of the DBSessionObject system class are set, and the DBHandle is set to null.
For more information about using these attributes, see How You Can Use the ErrorNumber and DBMSError Attributes.