Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DAO vs ADO 2

Status
Not open for further replies.

Bigtnmd

Programmer
May 30, 2000
2
0
0
US
Visit site
I have had a couple of people tell me that I cannot use DAO with Access 2000, and that I must use ADO.  No one can tell me why.  All my training has been in DAO.  
 
DAO - faster, but you can only have one connection at a time, which makes it very useless for most real world applications.<br><br>ADO - a tad bit slower, but much easier, and can have multithreaded connections, makes it more ideal especially for getting data serverside with Access, or getting data remotely anywhere with SQL Server, and other Data Server.<br><br>check my FAQ that i have posted on the small basics on how to use ADO with VB. <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML,Visual InterDev 6, ASP(WebProgramming), QBasic(least i didnt start with COBOL)
 
Email from Bigtnmd:<br><br><b><br>Thanks for your input.&nbsp;&nbsp;I have to connect a dB to a form for class.&nbsp;&nbsp;We have <br>had no instruction on ADO, so your FAQ helped and I will take them back to <br>class today.&nbsp;&nbsp;However, from what you said I could still use DAO, since the <br>application is only for one form and one table, and is my first ever attempt <br>at connection.<br><br>I attend Villa Julie College in Baltimore.<br><br>Thanks,<br>Bigtnmd<br></b><br><br>My response:<br><br><b><br>here is a cut/paste out of the MSDN for DAO<br>&quot;<i><br>What Are DAO and ODBC?<br>Home ¦&nbsp;&nbsp;Overview ¦&nbsp;&nbsp;How Do I ¦&nbsp;&nbsp;FAQ&nbsp;&nbsp;&nbsp;¦&nbsp;&nbsp;ODBC Driver List<br><br>Both Data Access Objects (DAO) and Open Database Connectivity (ODBC) are<br>application programming interfaces (APIs) that give you the ability to write<br>applications that are independent of any particular database management<br>system (DBMS).<br><br>DAO is familiar to database programmers using Microsoft Access Basic or<br>Microsoft Visual Basic. DAO uses the Microsoft Jet database engine to<br>provide a set of data access objects: database objects, tabledef and<br>querydef objects, recordset objects, and others. DAO works best with .MDB<br>files like those created by Microsoft Access, but you can also access ODBC<br>data sources through DAO and the Microsoft Jet database engine.<br><br>ODBC provides an API that different database vendors implement via ODBC<br>drivers specific to a particular database management system (DBMS). Your<br>program uses this API to call the ODBC Driver Manager, which passes the<br>calls to the appropriate driver. The driver, in turn, interacts with the<br>DBMS using Structured Query Language (SQL).<br><br>Note&nbsp;&nbsp;&nbsp;As a major part of the Microsoft Windows Open Standards Architecture<br>(WOSA), ODBC is here for the long run. DAO is optimized around the Microsoft<br>Jet database engine, but you can still access ODBC and other external data<br>sources via that engine, and the distinct ODBC API and the MFC classes based<br>on it are still available and still have their role to play in your<br>selection of database tools.<br>&quot;</i><br><br>As you can see it states DAO is oriented around only Jet Databases(usally<br>what the old Access database used to use) , but ADO would seem to be here to<br>stay, as it is suitible for almost all ODBC supported database, specifically<br>Access(2000 and below) and SQL Server, and DAO seems to be getting outdated<br>on the support.<br><br>-Karl<br></b> <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML,Visual InterDev 6, ASP(WebProgramming), QBasic(least i didnt start with COBOL)
 
I am also learning VB.&nbsp;&nbsp;I am currently creating a Database&nbsp;&nbsp;front end for an Access Database with DAO.&nbsp;&nbsp;Now all is fine and good now, however, should I want to make it more scalable, I assume I would have to implement ADO.&nbsp;&nbsp;Is there a way to convert an DAO app to an ADO app?
 
not that I know of, its funny tho is some one is always asking if there is a way to convert this to this, unfortunatly 99% of the time the answer is 'no' when it comes to converting code to code automatically, you would have to manually rebuild the program yourself. <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML,Visual InterDev 6, ASP(WebProgramming), QBasic(least i didnt start with COBOL)
 
My database won't connect to VB.&nbsp;&nbsp;Using Access 2000 and DAO.&nbsp;&nbsp;When I try I get a run time error, &quot;unrecognized database format&quot;&nbsp;&nbsp;Everyone tells me to use ADO, 2 more today.&nbsp;&nbsp;
 
Like I mentioned above, DAO was Jet Database Oriented, I do not belive Access2000 supports an old method anymore, and I think DAO is outdated, ADO also seems to be the pride and joy for microsoft, as almost all of their languages are able to use ADO in the exact same syntax(almost exact), and DAO is hardly mentioned. ADO isnt that hard to adapt over to. btw just to give it a shot with DAO, what connection command/string are you using? <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML,Visual InterDev 6, ASP(WebProgramming), QBasic(least i didnt start with COBOL)
 
VB does not recognize an ACCESS 2000 database format.&nbsp;&nbsp;You have to convert it to an earlier format. I am presently working with VB6 and Access2000.&nbsp;&nbsp;You have to open the database in Acess2000.&nbsp;&nbsp;Go to TOOLS/DATABSE UTILLITIES/CONVERT DATABASE/To PRIOR DATABSE VERSION.&nbsp;&nbsp;THen give database a new name (Access wont overwrite existing database).&nbsp;&nbsp;After you create the new database, you can just rename the old one and give the converted DB the original name.&nbsp;&nbsp;You do have to remember that if you open this database in Access again, then you will have to repeat these steps.&nbsp;&nbsp;Hope this helps.
 
VB6 does reconize Access 2000, you just have to use ADO 2.0 or above reference with it, anything else, will either make it crash, or not reconize it. <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML,Visual InterDev 6, ASP(WebProgramming), QBasic(least i didnt start with COBOL)
 
I don't use VB but write some VBA code within Access. MS documentation states that ADO is the default method for Access version 2000. MS has published a document showing corresponding code for DAO and ADO to help with the transition. Also by default Access 2000 does not include a reference to the DAO reference library but you can simply add that reference to continue using DAO. However, if you <i>mix</i> ADO and DAO, then you have a problem because for instance with the database object, Access doesn't know which model to use. So if you mix ADO and DAO in the dame database, you have to explicitly refer to objects. For example, if the db is DAO only <i>or</i> ADO only, you can use .dbs but if it has both you have to prefix it appropriately.<br><br>For more info, click on the FAQ tab to find the topics under &quot;Access Version or Conversion Related&quot;. There are embedded links there to the info you need.
 
Hey guys, I'm using VB6 SP3 with DA0 3.6 and I'm hitting an Access2000 database just fine.&nbsp;&nbsp;I could use ado, but it wasn't a key application, and only required one connection so I used DAO.<br><br>I just thought that my situation defied some posts in here.
 
hmm, well that would bring us another fact <br><b> update your visual basic </b> hehe. <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML,Visual InterDev 6, ASP(WebProgramming), QBasic(least i didnt start with COBOL)
 
I too am using dao 3.6 and vb6 with access 2000 database and the application behaves well...
 
I too am using dao 3.6 and vb6 with access 2000 database and the application behaves well...
 
Access 2000 does seem to be supported esp. in SP4 version of VB6 but VisData doesn't support 2000, neither does some of the wizzards and connection add-ins.
Does anyone know of updates for these?

 
Hi all,
To connect to Access 2000 :
1. Using DAO
You need the DAO 3.6. Below than it, forget it.
2. Using ADO
You need the MS Jet OLEDB 4.0 provider (MS ADO 2.5 or higher). Below than it, forget it
&quot;Unrecognized database format&quot; is a commonly error while attaching Access 2000 with old technology.

If you need to modify your database structure during run time (add/delete field, add/delete index) DAO still more flexible than ADO.

Speaking about DAO's future, it sound doesn't so brightly. I read at MSDN that in VB 7 (VB.NET) only ADO will support the bound method. DAO and RDO can only be used if we're choosing unbound method. To me it seems like MS wants to get DAO out of the game.

Perhaps in VB 8 we can't use DAO at all?(-:

 
I got SP4, should I install it, or will it mess up my DAO with Access97?

-Gary They never have to knock if your door is always open.
 
No, service pack 4 by itself will not mess up your Access 97. You will simply have 2 different versions of DAO residing on you machine at the same time. Your older applications that talk to Access97 will still be referencing the old library. Any new apps that you write using DAO 3.6 to talk to Access2000 will reference the new library. - Jeff Marler
 
Thanks Jeff, MS's documentation was a little &quot;loose&quot; on the subject. I don't upgrade unless I can get somthing out of it.
Is there anything else weird or wonderfull about the upgrade that you found? I have about 50 laptop programs in the field and a few more here that I do not want to fubar.

;-) They never have to knock if your door is always open.
 
I also see that VB SP5 is out. Anyone using this one?

-Gary They never have to knock if your door is always open.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top