August 1999
Intermediate to advanced
1488 pages
72h 53m
English
database.majorErrorMessage()
The majorErrorMessage() method of the database object contains the ODBC or database string error message that is returned if an error occurs.
Listing 8.46 shows how you would create a connection and test for a successful connection. If the test fails, the majorErrorMessage() is used when writing the error to the page.
<SERVER> // Open a connection var myConn = database.connect("ORACLE", "mySID", "myApp", "appsPWD", "myTNS"); if (myConn.connected()) { // You are connected, so perform any tasks here }else{ // There was an error connecting to the database write('Error ('+myConn.majorErrorCode()+'): ... |
Read now
Unlock full access