Converting DAO to ADO in vc++ 6.0

Category: visual studio vc


Sankar540 on Thu, 06 Jun 2013 18:48:46


I have access 97 database and  was using DAO SDK to manipulate/insert/update data  with vc++ 6.0.

Now i am converting my access 97 database to access 2007. 

What is the process need to follow with out changing vc++ 6.0 code base?

NOTE: I need to support in all OS version(including 64 bit).


Brian Muth on Thu, 06 Jun 2013 20:04:03

What is the process need to follow with out changing vc++ 6.0 code base?

I'm not sure what you are expecting as an answer. It's pretty self-evident to me. You have to replace all the ADO calls with ADO equivalents. There are no issues writing ADO code using VC6, although most of the code samples you find online will be in VB6. The conversion to VC6 code is straightforward assuming you have some familiarity with COM.

Sankar540 on Fri, 07 Jun 2013 07:45:21

Hi Brian,

I was asking is there anyway all the DAO calls replaced with ADO.

So you were saying we "can not replace all the DAO calls with ADO equivalents".

I have couple of questions related to this.

  1. Is there any single method exist which we can do it automatically or do we need to do manually?
  2. Will it work for all access versions(97 to 2007) for all WIN O.S (32 bit as well as 64 bit) assuming we have replaced all DAO with ADO equivalents?
  3. I have access 2007 template say abcTemplate.accdb and i have got user database which is in .mdb format which was created in earlier versions of access. Do i need make any changes while accessing/open/modify user database using vc++ 6.0? Can i send back to the user with the same format which he had sent  after modify some table data?

Thanks & Regards,


Brian Muth on Fri, 07 Jun 2013 16:07:10

There is no automatic way I know of that automatically converts DAO calls to ADO calls. This is a manual effort.

The implementation of ADO doesn't depend on the underlying type of database. The connection string is the only thing that changes if the database changes. Yes, it will work for all Microsoft Access versions, as well as SQL databases, and any ODBC database (MySql, Oracle, etc.). It even works for Excel workbooks.

Based on your questions, you need to do a little background reading on ADO. Here is a tutorial to get you started.

Sankar540 on Fri, 07 Jun 2013 16:56:37

Thanks Brian.