SQLInstallerError (odbccp32)
Last changed: -76.79.46.10

.
Summary
SQLInstallerError returns error or status information for the ODBC installer functions.

C# Signature:

[DllImport("odbccp32", CharSet=CharSet.Auto)]
public static extern SQL_RETURN_CODE    SQLInstallerError(
                int        iError,
                ref int        pfErrorCode,
                StringBuilder    lpszErrorMsg,
                int        cbErrorMsgMax,
                ref int        pcbErrorMsg);

VB Signature:

Declare Function SQLInstallerError Lib "odbccp32.dll" (TODO) As TODO

User-Defined Types:

public enum SQL_RETURN_CODE : int
{
    SQL_ERROR            = -1,
    SQL_INVALID_HANDLE        = -2,
    SQL_SUCCESS        = 0,
    SQL_SUCCESS_WITH_INFO    = 1,
    SQL_STILL_EXECUTING    = 2,
    SQL_NEED_DATA        = 99,
    SQL_NO_DATA        = 100

}

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

StringBuilder    errorMesg        = new StringBuilder( 512 ) ;
int                errorCode        = 0 ;
int                resizeErrorMesg    = 0 ;

//
// Get the error message
//
SQL_RETURN_CODE    retCode    = SQLInstallerError(    
1,             ref errorCode,
            errorMesg,
            errorMesg.Capacity,
            ref resizeErrorMesg ) ;

Alternative Managed API:

Do you know one? Please contribute it!

Documentation