Now's a fine time to ask but ADO or DAO?

  • Thread starter Thread starter Fred Wilson
  • Start date Start date
F

Fred Wilson

Hello all,

I have an MS Access 2003 database that I use as a tool to manage some
reports and data dumps from an oracle.

Anyway, which is the better records set to use, ADO or DAO and why?

Thanks,
Fred
 
If you disambiguate, both can be used. IMO, it would be DAO for most of the
work. ADO is designed to be faster with SQL-Server and for the most part it
is. It does not have all the functionality of DAO, but will do the majority
of what you may need to do. ADO is not being developed any more in favor of
ADO.NET. The 2 are not alike. That alone would put a damper on my deployment
plans.
 
Arvin said:
If you disambiguate, both can be used. IMO, it would be DAO for most of the
work. ADO is designed to be faster with SQL-Server and for the most part it
is. It does not have all the functionality of DAO, but will do the majority
of what you may need to do.

I agree the general sentiment but I think your post contains a
misstatement: I would say an ADO recordset has much more in the way of
functionality than a DAO recordset: an ADO recordset can be
disconnected, asynchronous (DAO recordsets have no events),
hierarchical, fabricated, used for paging, persisted on disk (including
XML format), etc.

Jamie.

--
 
Jamie Collins said:
I agree the general sentiment but I think your post contains a
misstatement: I would say an ADO recordset has much more in the way of
functionality than a DAO recordset: an ADO recordset can be
disconnected, asynchronous (DAO recordsets have no events),
hierarchical, fabricated, used for paging, persisted on disk (including
XML format), etc.

My comment on "all the functionality" was not meant to be specific to
recordsets, but to other things like security, replication, etc. While ADO
does address these things, it's not as complete, and it's through auxiliary
processes like JRO and ADOX.

I use them both, but use DAO more often because I use JET more often than
SQL-Server. I only use ADO with SQL-Server where it is for the most part
faster and, usually, easier.
 
Arvin said:
My comment on "all the functionality" was not meant to be specific to
recordsets, but to other things like security, replication, etc...

That's kind of a different question you've answered said:
While ADO
does address these things, it's not as complete, and it's through auxiliary
processes like JRO and ADOX.

Again, you're skewing the argument, probably unintentionally. ADO is a
collection of components, comprising ADODB, ADOX, JRO and a few others.
This organisation of components is by design. See:

ADO Component Libraries
http://msdn.microsoft.com/library/d...us/odeopg/html/deovradocomponentlibraries.asp


"To minimize the memory use of your solution, you can reference only
the ADO components your solution requires."

Jamie.

--
 
My comment on "all the functionality" was not meant to be specific
to recordsets, but to other things like security, replication,
etc. While ADO does address these things, it's not as complete,
and it's through auxiliary processes like JRO and ADOX.

And even then, with all those auxiliaries, it doesn't provide access
to everything in Jet. For instance, I find JRO completely useless
for replication, because it lacks way too many features that are
provided in the combination of DAO and the TSI Synchronizer. The
whole ADO thing was very poorly handled by Microsoft and I recommend
against even bothering with ADO in Jet-only scenarios except for the
one or two Jet features that are available only through ADO.
 
David said:
[ADO] doesn't provide access
to everything in Jet. For instance, I find JRO completely useless
for replication, because it lacks way too many features that are
provided in the combination of DAO and the TSI Synchronizer. The
whole ADO thing was very poorly handled by Microsoft and I recommend
against even bothering with ADO in Jet-only scenarios except for the
one or two Jet features that are available only through ADO.

As you say, there is some Jet functionality available only to DAO and
some functionality available to only to ADO (more correctly, the MS Jet
4.0 OLE DB provider). I'm willing to believe JRO is useless for Jet
replication. But returning to the OP's question:

I think the answer must be the ADO recordset because it has more
functionality. Sorry to be repetative but disconnected, asynchronous,
fabricated, hierarchical, pesisted on disk (even combinations thereof):
those are things that can be done with an ADO recordset that cannot be
done with a DAO recordset.

Jamie.

--
 
I dont believe that there is ANY verbage that is supposed in DAO but
not in ADO

I can add columns; ALTER TABLE ADD COLUMN

use SQL Server; the bottom line is that it's ridiculous to have 2 Data
Access Layers; one for a Junior Database and one for the Enterprise
Level Database.

This stuff is basic stuff that MS taught us what.. 10 years ago?

You kids are overthinking this; don't use DAO for anything ever

-Aaron




Jamie said:
David said:
[ADO] doesn't provide access
to everything in Jet. For instance, I find JRO completely useless
for replication, because it lacks way too many features that are
provided in the combination of DAO and the TSI Synchronizer. The
whole ADO thing was very poorly handled by Microsoft and I recommend
against even bothering with ADO in Jet-only scenarios except for the
one or two Jet features that are available only through ADO.

As you say, there is some Jet functionality available only to DAO and
some functionality available to only to ADO (more correctly, the MS Jet
4.0 OLE DB provider). I'm willing to believe JRO is useless for Jet
replication. But returning to the OP's question:

I think the answer must be the ADO recordset because it has more
functionality. Sorry to be repetative but disconnected, asynchronous,
fabricated, hierarchical, pesisted on disk (even combinations thereof):
those are things that can be done with an ADO recordset that cannot be
done with a DAO recordset.

Jamie.

--
 
Jamie Collins said:
. . . But returning to the OP's question:


I think the answer must be the ADO recordset because it has more
functionality. Sorry to be repetative but disconnected, asynchronous,
fabricated, hierarchical, pesisted on disk (even combinations thereof):
those are things that can be done with an ADO recordset that cannot be
done with a DAO recordset.

It's only "better" if the features you list are required, or useful, in
addressing the business problem -- and they often are neither required nor
useful. And, in my experience, it is mostly or always in situations where
the data is being kept in Microsoft SQL Server where they are useful -- a
case that Arvin already addressed as being appropriate for ADO.

In fact, they are often "useful" only to demonstrate the "advanced"
techniques used by the developer, that is, to "wow" clients with how
up-to-date and accomplished the developer is with the "new stuff." My
clients are 'way too practical to be impressed -- they want a quick,
efficient, low-cost solution to the business problem. And, their "BS
repellent" is to hustle the BSer out the door.

Larry Linson
Microsoft Access MVP
 
no Larry.. better means 'more relevent'

'more likely to be supported in the future'

not 'whats going to have the easiest upgrade path to vista' but 'whats
going to run without an upgrade path, plug and play'

from what i've seen.. Vista comes with a new version of ADO; but not a
new version of DAO lol

DAO hasn't been included with Windows for what.. 5 years?


yes; I support your concept of a 'BS repellent'

but finding an ancient Access programmer to write against a library
that has been dead-- for 5 years-- for good reason (because of hangs)

that sets off my 'bs detector' for sure

your premise is that 'old development was in DAO and it's not worth the
effort to change it'

were asking about NEW DEVELOPMENT

whats' easier.

anything that you can do in DAO; I can do in ADO with my eyes closed.

most importantly; ADO provides a much cleaner upgrade to ADOMD - as in
MULTI-DIMENSIONAL

try doing THAT with DAO (and btw, if your obsolete database programmer
doesn't speak SQL Server or Analysis Services; find someone that does)

-Aaron
 
Arvin,
(Other please feel free to replay)

Whilst on the subject, I wander if I can increase speed:

I have a table that maintains holidays rules/date around the world, 800
records so far and growing. There are other "supporting" tables needed, but
let leave it out for now.

Background:
-------------
Each holiday has its own rule. Some of the rules are simple (eg 25 Dec, or
4th Thursday in Nov), others are more involved (eg. if an holiday falls on a
weekend, Move it to Monday). Yet others depend on another holiday (eg. 46
days after Easter Sunday).

In addition, each rule has its own calendar (Gregorian, Hebrew, Islamic so
far) with or without a cross-over, e.g Easter Sunday falls on the First
Sunday after the Jewish Passover (with exceptions)

I have the relevant routines to calculate the fields "ThisYearDate" and
"NextHolidayDate" (not always the same, "US presidential Election" has Null
value in isYearDate" (2006) but has a value in "NextHolidayDate", 4 Nov,
2008), *NO PROBLEM* thus far.

Each time a user enter a record, through the OnCurrent event, those two
dates get updated through a combination of a Private and a Public Functions.
The same happens, through AfterUpdate event of any field that affects the
rule (Only Admin can do that), still no problem there.

Regardless of the calendar used to calculate the holiday date, *both*
"ThisYearDate" and "NextHolidayDate" return the date in Gregorian calendar,
eg. Jewish New Year which is the first day of the year in the Hebrew
calendar will return 23 Sep 2006 (this year) and 13 Sept 2007 (next date)

The Problem
--------------
Once a year, soon after new year day, I run an update query to update all
the dates in the table. That query runs for about *15 minutes * with 800
records, not surprising under the circumstances described above.

The Question (finally)
----------------------
Having written those a few years back when I did not understand what
Recordset or DAO means, I wander whether I should modify the routine for a
yearly update to reduce the time of a full update. I am in two minds:

1. If ain't broken, don't fix it
2. If I can speed up the operation dramatically using DAO, I can allow
users to do a general update any time.

Thus far all the calculations are done by whatever DLookup()'s returns.
Bearing in mind that if a holiday date is linked to another holiday, that
other holiday has to be calculated first.

Appreciated your comments

Regards
Jacob
 
I'd just prepopulate it for every year form here to kingdom come

I mean; is the day of week for July 2048 going to change?

for the records; this is frequently touched on in the data warehousing
world as a 'date dimension'

what's exciting about analysis services is that you can roll up your
calender in a dozen different directions; based on say 'jewish
calender' and 'fiscal calendar' and 'holiday calender' and 'physical
calender' and just drag and drop to show different versions.

it's free with SQL Server; it's called 'analysis services' but I really
reccomend a book or a class or 3

HTH

-Aaron
 
Larry said:
It's only "better" if the features you list are required, or useful, in
addressing the business problem -- and they often are neither required nor
useful.

In fact, they are often "useful" only to demonstrate the "advanced"
techniques used by the developer, that is, to "wow" clients with how
up-to-date and accomplished the developer is with the "new stuff." My
clients are 'way too practical to be impressed -- they want a quick,
efficient, low-cost solution to the business problem. And, their "BS
repellent" is to hustle the BSer out the door.

Impressing client with COM-based middleware? Claiming ADO is
up-to-date? Sounds a bit far fetched <g>. In my experience, clients ask
for "XML" and "dot net", seemingly without knowing what those things
mean (tip: such clients would be impressed if you ship and install the
..NET framework - who says you have to use it <vbg>).

Personally, my use of ADO is strictly under the covers. Typical usage
example: I have lots of VBA class modules for business objects (i.e.
designing components for other coders to use) in a hierarchy: parent
class, collection classes, child classes with a further collection
classes, etc; I mainly use a Collection (to expose IEnumerable hence
support For Each) for the collection classes but often also use a
fabricated disconnected ADO recordset to hold pointers to the children
along with strongly-typed fields to hold property values so that I can
use Sort, Filter, GetRows (output any array), GetString (output
formatted text), etc.

Another time there were no methods, just data headed for a treeview
control, so I used a fabricated hierarchical ADO recordset instead of a
hierarchy of classes, again under the covers.

FWIW I hold 'dumb' pointers to parent objects that are 're-hydrated'
when required (using CopyMemory API), avoiding circular references and
associated memory leak problems. Shame I can't say the same thing about
the DAO object model ;-)

Does any of the above (i.e. leveraging ADO functionality rather than
re-engineering my own) sound to you like "useful" or more like "BS"?
I'm not even sure any of that kind of stuff would impress you, Larry,
let alone a *client* e.g. you might say, "I don't *require* a
fabricated ADO recordset to sort child objects because I can use a
strongly-typed array and a bubble sort." True, of course, but each to
their own, don't you think? I don't think the suggestion of me being
"BSer" because I use ADO is due. Admittedly, the above sounds like the
coder's equivalent to a guitarist describing some signature guitar
solos but then you've got me all defensive now said:
in my experience, it is mostly or always in situations where
the data is being kept in Microsoft SQL Server where [disconnected,
asynchronous, fabricated, hierarchical, persisted on disk, etc]
are useful

I'm interested. Please give an example from your experience where you
used the ADO recordset features mentioned for data stored in Microsoft
SQL Server that wouldn't also be useful for data stored in Access/Jet.
Thanks in advance.

Jamie.

--
 
You're in my kill file, so I've obviously already concluded that
you're a worthless idiot, but I can't say exactly what type, but
these kinds of statements need rebuttal:

Jamie Collins said:
I think the answer must be the ADO recordset because it has more
functionality. Sorry to be repetative but disconnected,
asynchronous, fabricated, hierarchical, pesisted on disk (even
combinations thereof): those are things that can be done with an
ADO recordset that cannot be done with a DAO recordset.

But why in the world would you need those, except in very
specialized cases? Most of those are most helpful with a server
database, which Jet is not, so the benefits of using ADO on a
regular basis are simply not going to be there.

It is patently ridiculous to use a non-native data access method on
a regular basis just because there are a few rare cases where the
non-native method can do more things. Use DAO as a matter of course,
and use ADO in the rare cases where ADO provides something that DAO
does not.

Frankly, I question the value of any of the features you mention
when running with a Jet back end. I've certainly never ever needed
any of them myself in my 10 years of near full-time work with
database applications.
 
WOW! That was almost like asking about religion or motor oil.

The biggest thing I think I saw here was that because I only use JET
that DAO is more than adequate.

WOW again. Thanks for the input.
 
Fred

you're full of ****ing shit

DAO causes HANGS
Don't use it for anything and don't listen to these DAO dipshits that
are still stuck in the '90s

for that point; anyone that uses MDB should be fired and then spit
upon.. but the bottom line is that it's NEVER acceptable to use MDB for
anything.

if you care enough to build a database; and you look at your calendar
and you see that the year is greater than 2000.. you shoudl realize
that MS has been giving away a freeware version of SQL Server since '99
and MDB is thus completely obsolete and pointless.

Lose the training wheels.

MDB is NOT a valid option.
Moreover; using DAO is even _LESS_ of an option... it HANGS YOUR
****ING MACHINE ALL THE TIME

-Aaron
 
Jamie Collins said:
I'm interested. Please give an example from your
experience where you used the ADO recordset
features mentioned for data stored in Microsoft
SQL Server that wouldn't also be useful for data
stored in Access/Jet.

Perhaps I wasn't sufficiently clear... the methods you describe as
justifying ADO are, in my experience, not necessary in the database and
other applications that I have addressed in nearly 50 years in the computer
business. Perhaps ADO makes those techniques easier for you, even with Jet,
but because I don't implement business applications in that manner, I don't
find ADO useful.

My clients prefer applications that are implemented in a simple,
cost-effective manner that meets their business requirements. I comply with
their wishes, and that does not include using complex techniques that
require ADO. MDB, DAO, ODBC, and SQL Server works nicely.

Others have said they think that ADP, ADODB, and SQL Server is good, but I
note that the Access team at Microsoft now is back to recommending the
traditional MDB, DAO, ODBC, and SQL Server as the implementation approach of
choice for Access clients.

Larry Linson
Microsoft Access MVP
 
Larry said:
in my experience, it is mostly or always in situations where
the data is being kept in Microsoft SQL Server where [disconnected,
asynchronous, fabricated, hierarchical, persisted on disk, etc]
are useful

I'm interested. Please give an example from your
experience where you used the ADO recordset
features mentioned for data stored in Microsoft
SQL Server that wouldn't also be useful for data
stored in Access/Jet.

Perhaps I wasn't sufficiently clear... the methods you describe as
justifying ADO are, in my experience, not necessary in the database and
other applications that I have addressed in nearly 50 years in the computer
business.

Likewise, perhaps I wasn't sufficiently clear :)

I think we can agree that those ADO recordset features are not
*necessary* in a database application.

What I was interested in was your aforementioned *experience* where the
features were *useful* for SQL Server data; specifically, I was
wondering why they would not be *useful* if the data store was Jet.

Thanks again.

Jamie.

--
 
David said:
You're in my kill file, so I've obviously already concluded that
you're a worthless idiot, but I can't say exactly what type, but
these kinds of statements need rebuttal

So there's "worthlessly idiotic (type unknown)", then there's "so
worthlessly idiotic (type unknown) it deserves a reply"? Well, there's
hope for me yet said:
I question the value of any of the features you mention
when running with a Jet back end. I've certainly never ever needed
any of them myself in my 10 years of near full-time work with
database applications.

As usual we find ourselves in disagreement (and, let's be honest, the
reason I'm in your 'kill file', along with many others, is because I
once dared to disagree with you). My criteria for choosing a component,
feature, approach, etc is not "Do I need this?" but rather "Can I add
value using this feature?"

A close analogy to the 'ADO vs DAO' thing is the 'OOP vs traditional
programming' thing in VBA. Sure, VBA isn't the best language for an OOP
approach and it certainly isn't necessary (well, perhaps it is needed
for GUI programming e.g. could you live without Form events in Access?)
but that does not mean it can't be useful or cannot add value. The main
problem is, a paradigm shift is required to seriously consider new
technology and new approaches and it is human nature to resist change.

Just for fun, I wonder where we'd be had events been reversed. Imagine
the first data access technology is ADO: feature rich, flat object
model, etc but it is generalist and there is some fairly obscure
Access-only functionality it doesn't support. Then Microsoft introduces
DAO and bills it as "The new way to access Access data"; its main
selling point being that it is native to Access/Jet but is missing some
functionality, doesn't support Jet 4.0 features, has a more rigid
object model (with a serious bug requiring objects to be explicitly
destroyed but in the correct order), doesn't work well with other SQL
products (so you have to maintain separate code bases) plus the
learning curve that comes with a new technology that behaves similar to
but significantly different from its predecessor. What percentage of
ADO programmers would remain loyal?

Jamie.

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

DAO vs ADO 5
ADO vs DAO 14
ADO vs. DAO 35
ACC2003/2007 + SQL Server ADO or DAO 10
DAO IS DED 16
ado upgrade or dao 3
DAO to ADO 1
Should I Learn DAO, ADO or ADO.NET ? 2

Back
Top