Click here to Skip to main content
12,949,083 members (61,793 online)

Connection from MFC 64 bits DLL to a 32 bits Server Database

Member 3615972 asked:

Open original thread
I've developed a 64 bit MFC DLL wich needs to connect to a remote MySQL database on 32 bit server.
Used C++ MFC ODBC Consumer class derived from CRecordset.
When opening the Recordset
CustomRecordset.Open(CRecordset::snapshot,L"DSN",CRecordset::none) ODBC Dialog shows Cannot connect to MYSQL Server.
Created DSN's with both odbc administrators in C:\Windows\System32 and C:\Windows\SysWOW64. Not success.

It seems to me that the ODBC driver manager needs to communicate 64 bits application with driver in 32 bit mode.
However it's doing so in 64 bit mode, because in a localhost MySQL server (64 bits) the connection is successful.

May be it's neccesary to add any Macro or Connection Handle instruction into the DLL source code?

OS: Win 7 64 bits Ultimate
IDE: MS Visual Studio 10.0
Connection Driver installed: MySQL ODBC Connector 5.1.11 64 bits
The DLL runs into a 64 bit C++ Host Application.
Tags: C++, database


When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the The Code Project Open License (CPOL).

Advertise | Privacy | Mobile
Web02 | 2.8.170524.1 | Last Updated 26 Mar 2009
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100