GetErrorMessage (ODBCQuery - LotusScript)

Returns the short error message text associated with an error code.

Defined in

ODBCQuery

Syntax

message$ = odbcConnection . GetErrorMessage( [ errorvalue ] )

message$ = odbcQuery . GetErrorMessage( [ errorvalue ] )

message$ = odbcResultSet . GetErrorMessage( [ errorvalue ] )

Parameters

errorvalue

Optional. The error number returned by the GetError method or by DB_LASTERROR to refer to the last error for an ODBC object. The following named constants identify the error numbers:

DBstsSUCCESS

Not an error, SUCCESS (cannot be trapped by ON ERROR)

DBstsACCS

Unable to get user ID and password

DBstsAHVR

The previous added row has not been updated

DBstsBADP

Bad parameter

DBstsCANF

Cannot find named data source

DBstsCARR

Cannot access requested row

DBstsCCON

Unable to connect

DBstsCNVD

String length exceeded

DBstsCNVR

Cannot convert data from native to expected or requested datatype

DBstsCOAR

Operation not allowed on AddRow workspace

DBstsCPAR

Cannot position at AddRow

DBstsCXIN

Could not execute insert or update

DBstsENTR

Entry missing

DBstsEOFD

End of data has been reached

DBstsFAIL

The operation failed for unspecified reasons

DBstsHSTMT

ODBC could not allocate a new statement handle

DBstsILLG

Unrecognized or illegal data type

DBstsINTR

Internal buffer limit reached when creating a string

DBstsINVC

Field ID is out of range

DBstsINVR

Invalid row number

DBstsMEMF

Out of memory

DBstsNAFI

Cannot insert new row before AddRow

DBstsNCOJ

No valid connection object

DBstsNCOL

Table did not return any columns

DBstsNCON

Not connected to a data source

DBstsNODA

The result contains no data

DBstsNOEX

Never executed successfully or result set closed

DBstsNQOJ

No valid query object

DBstsNUNQ

Update or Delete cannot locate a unique data row

DBstsODBC

ODBC could not complete the requested operation

DBstsPMIS

Missing parameter in query

DBstsRCHG

Original row data changed. Cannot be updated or deleted

DBstsRDON

Read Only. Data cannot be updated or deleted

DBstsROWD

The row has previously been deleted

DBstsRUNC

No changes in row

DBstsSNFD

A resource string could not be found in the resource file

DBstsUBLE

Column Not Updateable

DBstsUNIM

Unimplemented feature

Return value

message$

String. The error message that corresponds to errorvalue. The message begins with "LS:DO" to distinguish it from other LotusScript messages.

Usage

You can test for an error with one of the following techniques:

  • Check the return value of GetError immediately after a method or property is used.
  • Create an error handler and use On Error.

Language cross-reference

@Failure function in formula language

Example