DAO Database functionality in C++ called from a 64 bit app.

  • Thread starter Thread starter Roy Holmberg
  • Start date Start date
R

Roy Holmberg

Guest
Hello,
I write 3rd party software in C++ that runs on top of an engineering program called AutoCAD. We have various applications that do this but one of them Creates , Accesses and manipulates a database using the DAO functions offered by MFC's CDaoDatabase with some CDaoRecordset's in it. This .dll (which AutoCAD calls an .arx) has to be generated as an x64 app on the 64 BIT version of AutoCAD (i.e. the one that installs automatically on XP 64 and Vista 64) .

The generated database is used by another 32-bit portion of our software. This works well because the JET engine and the new ACE engine (for Access 2007) are both 32 bit from what I can tell and run in WOW64 on a 64bit machine. So our 32 bit software has no trouble getting at these databases.
But my piece of the puzzle, that has traditionally generated the database, cannot use the DAO functions any more when I try to build the project as an x64 app. It give me :
fatal error C1189: #error : DAO Database classes are not supported for Win64 platforms
This error makes sense to me , knowing that the JET and ACE database formats are both only in 32bit.
Also, the _AFX_NO_DAO_SUPPORT preproccesor variable gets set in there somewhere as well when building an x64 build, so a host of other DAO dependencies don't get defined as a result.

So to get around this problem on the 64 bit version of this project, I've decided to create a 64bit wrapper for the DAO functions so I can call them from my 64 bit app and still generate that .mdb file I've been generating that's 32 bit compliant and can be picked up by our other 32-bit in Wow64.

I am just setting out to write my own wrappers (as is suggested here: CDaoDatabase class) but then I thought , I'm sure other people have had this problem and to see if anyone has already created a wrapper to get at DAO functions from a 64 bit app, that's out there somewhere. I looked around on MSDN and online in general and didn't find anything.
Any help would be much appreciated,
Roy

A couple references that convinced me to try this tactic instead of converting to ADO or OLE DB:
Developing Access 2007 Solutions with Native C or C++
Developing Access 2007 Solutions with Native C or C++

Accessing 32-bit DLLs from 64-bit code
名古屋で人気があるおすすめ英会話スクール10選

Continue reading...
 

Similar threads

Back
Top