Help Center

CODBCBase.SetErrorProcmethod

Sets the address of an application defined error callback.

DatabasesmethodCODBC.incdocumented

Syntax

SUB SetErrorProc (BYVAL pProc AS ANY PTR, BYVAL reportWarnings AS BOOLEAN = FALSE)

Parameters

NameDescription
pProcAddress of the application defined callback.
reportWarningsOptional. Report also warnings.

Description

Sets the address of an application defined error callback.

Example

SUB ODBC_ErrorCallback (BYVAL nResult AS SQLRETURN, BYREF wszSrc AS WSTRING, BYREF wszErrorMsg AS WSTRING) PRINT "Error: " & STR(nResult) & " - Source: " & wszSrc IF LEN(wszErrorMsg) THEN PRINT wszErrorMsg END SUB

pDbc.SetErrorProc(@ODBC_ErrorCallback) ' // Sets the error callback for the connection object pStmt.SetErrorProc(@ODBC_ErrorCallback) ' // Sets the error callback for the statement object

Reference

  • Include file CODBC.inc
  • Defined in AfxNova/COdbc.inc:118
  • Documented in Databases/ODBC Classes/CODBC Class.md
  • Topic: ODBC Classes