Error Handling with DP4DBAPI

In traditional DP4 C programs there is usually very little in the way of error handling. It is assumed that a database can always be opened, that a fetch will either succeed or return information that there is no record. The reason this is OK is that the database manager will set error status information when something untoward happens, and the interface code checks this status information after every call and generates a system or fail error if an error has arisen. Typically these errors terminate the program more or less gracefully, displaying an appropriate error message first. If the program survives the error (for example because it filtered the system or fail error using the app_error() facility) then the return code of the function will usually be set to some safe value

With DP4DBAPI you are responsible for handling all errors that might arise. There are two possible techniques for doing so: