Error Messages from the Connector

When the connector encounters error conditions either on the consumer or provider side, it must pass messages about the errors to the consumer.

The connector passes as much information as possible but in some situations, it cannot detect problems that have occurred.

OLE DB Object Services has a built-in message splitter that separates error messages into eleven pieces of information. These are:

  • A text string of the error message followed by carriage return / line feed characters.

  • The resource ID of the text string in the connector.

  • An HRESULT formatted as a long value.

  • An HRESULT formatted as a hexadecimal value.

  • The OLE DB object which encountered the error.

  • The source file name in the connector where the error was detected.

  • The source line in the connector where the error was detected.

  • The row number if the error was detected when processing a row in a rowset.

  • The row bookmark value if the error was detected when processing a row in a rowset.

  • The column number if the error was encountered when processing a row in a rowset.

  • The column name if the error was encountered when processing a row in a rowset.

The message splitter uses a vertical bar (|) character to delineate the portions of the message. The Error Message Splitter also provides special interpretation for Lawson application errors, as shown in the following code sample:

'strErrorMsg contains an error message retrieved from the ADO Connection Errors collection...

Dim oMsgSplitter As New LawsonErrMsgSplitter.Splitter

Dim vaPieces As Variant

vaPieces = oMsgSplitter.SplitMsg(strErrorMsg)

Debug.Print vaPieces(mpText) 'This is the initial text string, with the carriage return / line feed characters removed.

Debug.Print vaPieces(mpResourceID) 'This is the resource ID

Debug.Print vaPieces(mpLongHR) 'HRESULT as Long

Debug.Print vaPieces(mpHexHR) 'HRESULT as Hex

Debug.Print vaPieces(mpObject) 'OLE DB object

Debug.Print vaPieces(mpSourceFile) 'Source File Name

Debug.Print vaPieces(mpSourceLine) 'Source File Line Number

Debug.Print vaPieces(mpRow) 'Row Number

Debug.Print vaPieces(mpBookmark) 'Bookmark

Debug.Print vaPieces(mpColumnNumber) 'Column Number

Debug.Print vaPieces(mpColumnName) 'Column Name

Debug.Print vaPieces(mpLawsonErrNumber) 'Lawson Error Code if the error is being propagated from AGS

Debug.Print vaPieces(mpLawsonErrMsg) 'Lawson Error Text if the error is being propagated from AGS