Solved

ADO, DAO, DataControl ??

Posted on 2000-05-04
6
321 Views
Last Modified: 2013-12-25
I'd like to know in simple terms what the difference is between ADO, DAO and DataControl is so I can get an idea which I should be using.  In addition to the explanation, some links would be helpful.

The application I'm attempting to code right now is pretty simple, but I'd like to build more complex ones in the future if I can ever get a handle on this data access thing.

I'm using VB5, and Access 97 (would prefer to use Access 2000 if I could get that to work with VB5 : )  

Thanks
0
Comment
Question by:Eyekissed
6 Comments
 
LVL 69

Expert Comment

by:Éric Moreau
ID: 2779117
DAO = old technology mostly for accessing Access database.

ADO = Latest data access technology that can use much any data source. Focus on that one since DAO will die.

DataControl: A control that use DAO to facilitate data access. Note that an equivalent control exists for ADO.

One of the best link concerning this is http://www.microsoft.com/data/
0
 
LVL 6

Expert Comment

by:Marine
ID: 2780318
If you going to use Access you will get better performance with DAO because Dao was optimized for Jet.
0
 
LVL 1

Expert Comment

by:billyh
ID: 2781068
DAO: this technique might be old, but is very good for developing LAN-based applications only. That means if you application is to be used in a WAN enviroment it is going to fail badly. Anyway Bill Gates has decided to drop DAO and move on with OLE-DB, which is implemeted through ADO.

ADO is very powerful and connects to different types of Databases, including Oracle. ADO works for both LANs and WANs pretty well. That to me is the only difference. Other than that they are both used to connect to databases.

As for datacontrols, there are two types, there is the DAO data control called DATA in VB, and the ADO data control called ADDODC. This are meant to reduce the level of coding.
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 2

Expert Comment

by:Sage020999
ID: 2781511
I currently use both technologies in my programming.  Both have there pluses and minues.  ADO is growing to be a powerful tool, but is still quite lacking when it comes to Access databases, including the new 2000.  Data controls are nice tools but are limited.  There are only a few areas where I would concider using these.  They work extremly well when bound to other controls like spread sheets.
0
 

Accepted Solution

by:
jwilson earned 50 total points
ID: 2782074
If you're just starting out, ADO should be pretty straight forward, but if you need to automatically recover from LAN/WAN connection failures, or the database has been moved, this redirection cannot be accomplished using ADO (as far as I know anyway).

ADO also has significant resource overhead compared to DAO as it is geared towards multiple heterogenious databases...

If you only have 1 database then DAO is by far simpler to use for professional redirection (i.e. zero down time).

I tried to implement a 7x24 system (time recording system for payroll) using ADO, but it failed miserably in this area - DAO on the other hand worked very well for this.

A minus to DAO is it's lack of report protoyping.

Similarly a minus to ADO is it's limited support for a true object model (supposed to be corrected in VB 7's ADO), i.e. enforcing bound controls. To prove this point try to write a function in one project with ADO that you can take with you to another...

To those who disagree,
1. Try to write a function to recover
   from a loss of connection, etc. for
   ADO (my last crack was over 30 lines
   of code and ultimately fails).

2. Then try it with DAO (this one's only
   8 lines of code - 3 years of 7x24).

This last comment is towards emoreau:
Microsoft has announced that DAO will no longer be improved, i.e. no major problems exist, so please use our latest, buggy, marketing scheme - I don't think this should be interpreted as "DAO will DIE"...
0
 
LVL 1

Expert Comment

by:billyh
ID: 2796216
I depends on how much you have given yourself to ADO.

From a hardcore DAO programmer like you and me(jwilson), ADO is completly unfair. Have you ever tried updating a recordset that you declared locally in your code that access an Access DB through SQL.

None-the-less just like in DAO, its just a matter of time until we are comfortable with ADO. I used to have the same problem with lost connections, but I know use re-setting the CONNECTION STRING of the ADO connection, to get back my connection. Yes ADO is very sensitive, but as a programmer, you learn how to work with the limitations.

So don't scare "Eyekissed" ADO is very fun and is more effiecient that DAO in some instances. To "jwilson" try connecting to a SQL server using DAO.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now