Here is the code:
retcode = SQLAllocHandle (SQL_HANDLE_ENV, NULL, &henv);
// Notify ODBC that this is an ODBC 3.0 application.
retcode = SQLSetEnvAttr(henv, SQL_ATTR_ODBC_VERSION,
(SQLPOINTER) SQL_OV_ODBC3, SQL_IS_INTEGER);
// Allocate an ODBC connection and connect.
retcode = SQLAllocHandle(SQL_HANDLE_DBC, henv, &hdbc1);
retcode = SQLConnect(hdbc1,
(SQLCHAR*)"servername", SQL_NTS,
(SQLCHAR*)"username", SQL_NTS,
(SQLCHAR*)"pwd", SQL_NTS);
retcode = SQLAllocHandle(SQL_HANDLE_STMT, hdbc1, &hstmt1);
retcode = SQLExecDirect(hstmt1,
(SQLCHAR*)"SELECT au_lname FROM authors",
SQL_NTS);
All retcode values are 0; however when I execute SQLExecDirect, I get
"Unhandled exception at 0x1f7b94d2 in TestDriver.exe: 0xC0000005: Access
violation reading location 0x00000054."
I checked debug symbols - this happens inside odbc32.dll,
odbc32.dll!_EnterStmtCS@4() + 0x34
I am running XP SP1 / MDAC 2.7 (2.71.9030.4).
I assume something is wrong with my driver, but what? Any ideas?
"Igor Kuklin" <ig...@adessosystems.com> wrote in message
news:eHejlSs0CHA.2232@TK2MSFTNGP09...
"Igor Kuklin" <ig...@adessosystems.com> wrote in message
news:OGkG0Ot0CHA.1636@TK2MSFTNGP10...