Getsqlerrorcode, Getsqlerrorcode 22 – Kofax DM API User Manual
Page 243

DM API M
ETHODS
AND
P
ROPERTIES
223
GetSQLErrorCode
GetSQLErrorCode
This method retrieves the native SQL error code as returned by the
library’s database.
Syntax
PCDSQL.GetSQLErrorCode()
Returns
This method returns a long integer that contains the error code number
associated with the most recent SQL error. If zero is returned, no error
occurred.
Usage
The GetSQLErrorCode method differs from the
method.
If, for example, the Execute method returns an error, the ErrNumber
property should be used to identify the error number. ErrNumber
identifies a large number of error conditions, not all of which are
related to a structured query language operation. The
property returns the description for the most recent error. If an error
occurred, but it was not a SQL error, then GetSQLErrorCode returns
the value of zero.
If the ErrDescription or ErrNumber properties indicate that a SQL
error occurred, then the GetSQLErrorCode method will return one of
the following SQL-specific error codes:
Code
Description of SQL Error Code
0
No error
1
Missing DLL
2
Bad Connection
3
General Error
4
Fatal Error
5
Syntax Error
6
Invalid Logon