hi - i really need your help with this!
i have a self contained routine (that i am using for testing the QODBC driver) - the main portions of the code is below (i can email you the entire c file if you require).
When i call this routine from a self contained VS 6.0 application the code works beautifully - it connects and queries QuickBooks and displays the data.
However, when i compile this into a legacy C application and call this routine the SQLConnect routine fails - catastrophically! Total crash and it yanks the entire application out of memory! It does not return from the SQLConnect call.
When i change the routine to connect and query a SQL Server datasource (as opposed to the QuickBooks DNS) the routine works fine under both circumstances! So this implies it implies it is something to do with connecting via the QODBC driver.
I have been investigating this for 3 days and my brain is hurting. Is there anything you can think of that would cause the loading of or connecting via the QODBC driver that could cause such an error?
The legacy application uses ODBC conenctions with SQL server without any problems - it just seems to crash when loading the QODBC driver.
Code :
SQLHANDLE EnvHandle; SQLHANDLE ConHandle; SQLRETURN rc = SQL_SUCCESS;
SQLCHAR DBName[20] = "QBBellTran"; SQLCHAR DBUser[20] = ""; SQLCHAR DBPass[20] = "";
rc = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &EnvHandle);
rc = SQLSetEnvAttr(EnvHandle, SQL_ATTR_ODBC_VERSION, (SQLPOINTER) SQL_OV_ODBC3, SQL_IS_UINTEGER);
rc = SQLAllocHandle(SQL_HANDLE_DBC, EnvHandle, &ConHandle);
rc = SQLConnect(ConHandle, DBName, SQL_NTS, DBUser, SQL_NTS, DBPass, SQL_NTS);
If calls SQLConnect and crashes - windows does not catch it, no error message, no nothing - the entire application is yanked out of memory.
Any help is greatly apprecaited.
Please let me know if you need any more information.
|