DbPool.majorErrorMessage()

NES3+Syntax

							DbPool.majorErrorMessage()

Description

The majorErrorMessage() method of the DbPool object contains the ODBC or database string error message that is returned if an error occurs.

Example

Listing 8.62 shows how you would create a pool of connections and test for the connection. If the test fails, the majorErrorMessage() method is used to write the error to the page.

Listing 8.62 Using majorErrorMessage() to Retrieve a Database Connection Error
 <SERVER> // Create a pool of connections var myPool = new DbPool("ORACLE", "mySID", "myApp", "appsPWD", "myTNS"); if (myPool.connected()) { // You are connected, so perform any tasks here }else{ // There was an error connecting to the database write('Error ('+myPool.majorErrorCode()+'): ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.