Connection.majorErrorMessage()

NES3+Syntax

							connection.majorErrorMessage()

Description

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

Example

Listing 8.18 shows how you would create a pool of connections, pull a connection from it, and test for the connection. If the test fails, the majorErrorMessage() is used when writing the error to the page.

Listing 8.18 Using majorErrorMessage() to Retrieve a Database Connection Error
 <SERVER> // Create a pool of connections var myPool = new DbPool("ORACLE", "mySID", "myApp", "appsPWD", "myTNS"); // Open a connection from the pool. Give error if connection could // not be made. var myConn = myPool.connection('Employees', ...

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.