The CDatabase call to OpenEx() passes in the connect string and the flags
noOdbcDialog|useCursorLib.
When I look at the ODBC trace on MDAC 2.6 SP2, I can see the call to
SQLSetConnectOption with the parameter SQL_ODBC_CURSORS. After upgrading to
MDAC 2.7 and doing another ODBC trace, the call to SQLSetConnectOption with
the parameter SQL_ODBC_CURSORS is not in the log. The code was not
recompiled. So, it appears that CDatabase is behaving differently depending
on the version of MDAC installed. That is the first problem.
Sticking with MDAC 2.7, if I then go in and modify the code to add a call to
SQLSetConnectOption to set the ODBC cursor library option before I call
OpenEx(), the call to SQLSetConnectOption with the parameter
SQL_ODBC_CURSORS will appear in the ODBC trace log, but SQLDriverConnectW
returns SUCCESS_WITH_INFO and the following error:
DIAG [01000] [Microsoft][ODBC Driver Manager] Cursor library not used. Load
failed (0)
When I look at odbccr32.dll (the cursor library DLL) in Dependency Walker,
it looks like all the dependencies are there and there should be no problem
loading the DLL. That is the second problem.
Any ideas?
Based on my experience, the error "[Microsoft][ODBC Driver Manager] Cursor
library not used. Load failed (0)" may be caused that the ODBC Cursor
Library DLL (ODBCCR32.DLL) may not load with if the application uses an
older version of MFC42.DLL.
Prior to MDAC2.7 the ODBC Cursor Library DLL(ODBCCR32.DLL)was statically
linked to MFC library. In MDAC 2.7 we changed the ODBC Cursor Library DLL
ODBCCR32.DLL) to dynamic load the MFC librarary(MFC42.DLL). The ODBC Cursor
Library DLL does not work with older versions of MFC42.DLL.
I suggest you to rebuild your application in Visual C++ 6.0 with latest
Visual Studio 6.0 Service Pack 5, and check whether or not it works.
HTH
Regards,
HuangTM
This posting is provided "AS IS" with no warranties, and confers no rights.
Unfortunately, porting / rebuilding / retesting 1 million lines of code in
VC++ 6 isn't in our plan for the current release and I have customers on
Windows XP who can't downgrade their MDAC who are having problems. We are
going to port to VC++ 7.1 later this year, which I imagine will solve the
problem...
I'm suprised there was no disclosure of this problem previously and nothing
mentioned about it in the MDAC SDK release notes. I have searched in a lot
of places and did not find anything about this.
"Tian Min Huang" <timh...@online.microsoft.com> wrote in message
news:DGfYvjPM...@cpmsftngxa06.phx.gbl...
I noticed that there is a linker for VC5 in the July 2000 Platform SDK that
is supposed to understand the VC6 linker format. According to the
documentation it can be used to convert VC6 LIBs into VC5 format or it can
just be used in place of the VC5 linker.
"Tian Min Huang" <timh...@online.microsoft.com> wrote in message
news:DGfYvjPM...@cpmsftngxa06.phx.gbl...
Maybe you can try install VC6Redist which includes mfc42.dll to your
system, and then check whether or not it works.
VC6Redist can be found at
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:
80/support/kb/articles/Q259/4/03.ASP&NoWebContent=1
"Tian Min Huang" <timh...@online.microsoft.com> wrote in message
news:pXn2mUaM...@cpmsftngxa06.phx.gbl...
Thanks for your update. Generally speaking, laster version of MFC42.dll is
backward compatible with earlier version.
Have a nice day!