DAO v ADO

I just got myself a copy of Access 2003 at home and was surprised that the Northwind db used DAO not ADO.

I use A97 for all my apps so im pritty much limited to DAO anyway, but i was wondering why MS still used DAO in their sample db.


Open for discussion,  not really looking for an answer....

Dave
LVL 34
flavoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

dkmj17Commented:
If I had to guess... I would say it is to minimize work... I haven't looked at the northwinds in a while- but maybe they just took the 97 version and made a few minor changes, then sent that as the 2003...

Mike
0
flavoAuthor Commented:
That's what i thought, lazy, to busy with those new looking buttons to worry about doing an up to date sample?
0
pdebaetsCommented:
I think Microsoft is veering away from ADO in favor of ADO.Net.

Peter De Baets
http://www.peterssoftware.com
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

flavoAuthor Commented:
Yes, i am well aware of that, still doesn't explain why they decided to use DAO not ADO.  Considering Access will only let you use either one (or maybe RDO) without going to a .Net FE, i am curious as to why they used DAO.

why should i use ADO rahter than DAO (if i used A2k+) when they dont bother?

I know it enables you to upgrade to SQL server, but any other reason???

Dave
0
walterecookCommented:
Theoretically ADO is more extensible into the future as someday DAO will go away.  personally, though I know ADO, I usually go lazy and write in DAO as I can just do it so much faster.

Walt
0
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
According to several postings I've read on this, MS decided to repalce DAO as a default reference in 2003, due primarily to people complaining about it!!

As I see it, there's little reason to use ADO over DAO in a pure Access evnironment. DAO works better with Access, and is a complete solution (there are a few issues with ADO and User LEvel Security, plus DAO is faster in terms of data access). If, however, you EVER believe your application will be used with a different datastore (Oracle, MSSQL, MySql, etc etc) then I'd write my data access with ADO.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
plqCommented:
You can do things in DAO that you can't do in ADO like createquerydef, tables.append etc.

And the real good thing in DAO although probably not used in northwind is cross database queries, where you can join one table in one db to another table in a different db

Performance wise, they're both crap, so it comes down to what you prefer and what you know. Even ADO.NET isn't as functional as ADO in some ways, so I'd wait for ADO2.NET in whidbey before moving to ADO. At least DAO is built to perform well with access, so its probably less layers than ADO if you're sticking with an access db.
0
namliam_ehtCommented:
And dont forget all Jet recordsets by default are DAO. Like the me.recordsetclone and stuff.

Basicaly DAO has been split into several defirent parts ADO beeing one of them. I am unsure where they put the querydef and stuff tho. I have also been told that in the move from DAO (split) to ADO (and others) they purposly left out some parts of DAO....

"my $0.02"
0
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
>> You can do things in DAO that you can't do in ADO like createquerydef, tables.append etc.

Technically, you're correct, although you can use ADOX to do these things. Still, there are some limitations in regards to using ADOX, and I'd agree with you regarding using DAO with Access.

>> Basicaly DAO has been split into several defirent parts ADO beeing one of them

I've never heard this - ADO is probably more closely associated with RDO than DAO. I'm sure many of the same strategies were used to build both libraries - after all, they basically accomplish the same thing - but I don't think that you could argue that ADO was derived from DAO. If I'm wrong (and that's entirely possible), then I'd really enjoy reading some information on this!!
0
namliam_ehtCommented:
Hmz, well Its what i heard/read about and around from both co-workers and here and there on the web... Tho i have never heard of RDO.. till now that is LOL... You learn something new every day....

I personaly never used ADO, stick to what you know i allways say. And i havent found the need to use/switch to ADO.

I even heard that eventhought ADO is the default library for both 2k and XP, M$ switched back to DAO as the default for 2003....

Just another $0.02
0
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Yes, 2003 now includes by default a reference to the DAO library.

BTW, here's some references to the history of ADO. It's been around since 1996, although the first semi-stable relase would have been 1.5

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdmscwhatsnewinado.asp
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnaraccessdev/html/odc_microsoftofficedeveloperforumaccessadvancedadoforthevbaprogramme.asp

In some way, you could say that ADO "came from" DAO - after all, Microsoft built\borrowed both of the technologies, and if they had code libraries that could be used to interface with the lower level drivers, I'm sure they used those when considering strategies for the creation of ADO (much like you have a library of code that you use over and over).
0
stevbeCommented:
One thing you can do in ADO that you can not in DAO is build a recordset in memory ... no need for a table or any other datasource. It also is easier to disconnect and save out as xml, etc.

Another piece of DAO that was split out to a new library was replication into the JRO library.

ADO does replace other things ... like file I/O, you can open a text fiel and read the stream.

In DOA you can open a recordset for append only ... no need for bogus criteria to make sure you are not returning a boatload of records when all you want to do is add.

If you think the differences between ADO and DAO are substantial the only thing ADO and ADO.NET have in common is the letters ADO. They are structured entirely different.

I keep waiting for Office to become VBA.NET :-)

Steve
0
stevbeCommented:
As for the code in Nothwinds ... Not on your life would I allow code like that in one of my Apps :-)
I am sure they just tweak it to keep it limping along for each new version, it is just like DAO, they need to keep it aroud for compatability reasons only. If MS thought they could get away with killing DAO they would, but they can't because there is too much legacy code in production in fortune 500 companies for them to say ... nope, it no longer exists. Come on ... you can still write .bat files and that "went away" a long time ago.

Steve
0
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Yes ... I really like the disconnected recordset in ADO ... I've incorporated a strategy in my unbound apps that uses a disconnected recordset as "pointers" for the fronent ... I include my ID field(s) in the disconnected recordset and use that to grab data at the user's request. It allows me to build navigation buttons without tying up the entire table, and I can mimic the "feel" of Access.

So far I haven't really gotten into much XML, although the next big project from one of my aerospace clients will be very heavily dependant on data formatted in xml, so I'm beginning the learning process. Seems like a very portable, easily understood format ...
0
stevbeCommented:
The bigest thing I found in XML was learning schema validation ... I am so spoiled with "tables" and "relationships" enforcing validation, all I have to do is pick up the pieces in Access, that it took a while for me to be able to write the schema in XML. One of the reasons I found it tough is the extreme flexibility, you can create complicated requirements, way beyond what Access tables are capable of but it can be very hairy when you start to try and validate relationships ... ughhh.

There is not "right" way to store data in XML, whether "field" values are properties of a node or each field is a seperate node itself. You need to figure out how you are going to do this before you can even create the schema.

Steve
0
flavoAuthor Commented:
Gee's, you guys have been busy while i was sleeping.

Yes, i noticed DAO was the dafault in 2003, and was sure it wasn't in 2002 (confirmed now).

>> I keep waiting for Office to become VBA.NET :-)

Yes, i was wondering about that... Maybe Office 2005????....

I too haven;t really got into xml, just as much as i need...

Im glad i started this up, some good thoughts from all...

Seeing as it will be near imposible for me to use the Oracle servers for my apps, ill be more than happy to stick to DAO ( i  have too anyway...)

>> As for the code in Nothwinds ... Not on your life would I allow code like that in one of my Apps :-)

Not the best now is it...

Thanks guys!

Dave
0
flavoAuthor Commented:
I tired to split the points up, hope everyone is content.
0
namliam_ehtCommented:
I actually was not expecting anything.... But hey thanx :)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.