Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SQLDriverConnect() gives "user breakpoint" and no more help

1 view
Skip to first unread message

Jo

unread,
May 15, 2005, 11:03:20 PM5/15/05
to
I'm having a hard time getting this SDK's ODBC library to work for me.
I've been following the guide in the MSDN, but whenever I call
SQLDriverConnect(), I can select the machine source (in this case, it
uses the MySQL Connector/ODBC) then ok the login screen, and get a
"user breakpoint" before the function can return. That's not much help,
and I'm not aware of any exceptions I can trap. Here's my code:

SQLHDBC m_sqlconnection;
SQLHENV m_sqlenv;

...

SQLRETURN nReturn = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE,
&m_sqlenv);
assert(nReturn == SQL_SUCCESS || nReturn == SQL_SUCCESS_WITH_INFO);

nReturn = SQLSetEnvAttr(m_sqlenv, SQL_ATTR_ODBC_VERSION,
(SQLPOINTER)SQL_OV_ODBC3, 0);
assert(nReturn == SQL_SUCCESS || nReturn == SQL_SUCCESS_WITH_INFO);

nReturn = SQLAllocHandle(SQL_HANDLE_DBC, m_sqlenv, &m_sqlconnection);
assert(nReturn == SQL_SUCCESS || nReturn == SQL_SUCCESS_WITH_INFO);

SQLCHAR lpszStringOut[1024];
SQLSMALLINT nOutSize;
nReturn = SQLDriverConnect(m_sqlconnection, m_hWnd, (SQLCHAR *)"", 0,
lpszStringOut, 1024, &nOutSize, SQL_DRIVER_PROMPT);

Did I forget anything?

0 new messages