![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Dear Access experts, I have no experience writing ADO or DAO code but I am going to start soon. After reading up on ADO and DAO, it seems both can do the job for me. However, I do not know enough to know which one to choose. I am using Access2003 and the database will be used locally, not on a client-server environment. I will be mainly using ADO/DAO for queries. My preferred choice is the one with more readable code. Can the experts here advise me ADO or DAO? They are both equally "readable". DAO can do a few more things with a Jet |
#3
| |||
| |||
|
|
Dear Access experts, I have no experience writing ADO or DAO code but I am going to start soon. After reading up on ADO and DAO, it seems both can do the job for me. However, I do not know enough to know which one to choose. I am using Access2003 and the database will be used locally, not on a client-server environment. I will be mainly using ADO/DAO for queries. My preferred choice is the one with more readable code. Can the experts here advise me ADO or DAO? Thank you very much. |
#4
| |||
| |||
|
|
From the sounds of it, you're talking about using strictly Jet databases (i.e.: MDBs). That means you should use DAO. |
#5
| |||
| |||
|
|
So, use DAO for any MDB/ACCDB back end, or any back end accessed through ODBC. From where I sit, this basically means that you never use anything but DAO as your default database interface, since there's no reason why you'd be using anything other than MDB/ACCDB/ODBC. |

#6
| |||
| |||
|
|
On 7/14/10 11:23 AM, David W. Fenton wrote: So, use DAO for any MDB/ACCDB back end, or any back end accessed through ODBC. From where I sit, this basically means that you never use anything but DAO as your default database interface, since there's no reason why you'd be using anything other than MDB/ACCDB/ODBC. I'm reminded of the adage, "When the only tool you have in hand is a hammer, everything looks like nails." ![]() With a Jet backend, I very much agree that DAO is really the only tool we need. With ODBC backend, there are already a lot of things we can do even going through Jet that it's conceivable that we can build a good front-end client using nothing but DAO. But would I go as far to say it should be the *only* tool? |
|
No, not really. I do reach for ADO when there is a specific need for it, and it has served me well in few cases where DAO came up short. |
|
The cases are quite rare but when it does happen, I'm glad to have the luxury of choosing a different data access technology, even if ADO is dormant and superseded by newer technologies (in which I also hope the Access team will remedy somehow). |
#7
| |||
| |||
|
#8
| |||
| |||
|
#9
| |||
| |||
|
|
Like David said, if the BE is MDB or an ODBC then I use DAO. If on the other hand I want to be able to talk directly to a server at some point in the future (scaling up) and really want performance then I tend to dodge ODBC connections and instead use ADO to talk to the database server directly. It really depends on the app that is being built and the expected implementation - you can swap out an ADO connection to a different DB type quite easily if you need to. That being said, most of the stuff I write is DAO based as the requirement for ADO really doesnt exist for most cases. Jet with DAO works really well, its well tested and well understood. Keeping your code clean is another matter entirely. If you compare the code required to run a select query via DAO and ADO they are actually pretty similar in both form and logic. Its not hard to translate between them with a little practice. For most things, in Access, I would suggest DAO if you need to do code. You might also consider using queries and linked tables (for external data like a Back End (BE) MDB file). Depends on your use case, but I typically find they are fast, friendly, and reliable. |
#10
| |||
| |||
|
|
"DAO 3.6 was the final version developed by Microsoft. Microsoft says that DAO will not be available in its future 64-bit operating systems." Worth some attention? Sven |
![]() |
| Thread Tools | |
| Display Modes | |
| |