I cannot point to specific articles promoting a preference for DAO; however,
Microsoft does have an agenda, so I would expect them to promote the use of
ADO.
You will have to forgive me for not remembering specific versions, but at
some point in the past, MS changed the native format from DAO to ADO and
latter back to DAO.
I don't know what you mean by 'native format'. I think you might be
alluding to the default reference set to the DAO library in Access's
Visual Basic Editor i.e. a checkbox in the IDE. In Access 2000 it was
unchecked by default and it upset a lot of people who had to check it
manually to use DAO in a new project. From Access 2003 (IIRC) it has
been checked by default for DAO, as is also is for ADODB. To be
honest, I don't see why it was such a big deal but I'm glad ADO and
DAO are now both checked and everyone is happy
Generally speaking, ADO has more (and arguably improved) properties,
methods and events and via the OLE DB provider has some Jet 4.0-era
functionality not available to DAO or ACEDAO (the Access 2007
version). Similarly ACEDAO has Access 2007 engine functionality not
available to ADO via the OLE DB provider. On a larger scale there are
many subtle differences between ADO and DAO, of course, but the
mutually exclusive functionality tends to be of specialist interest
only.
Given the current position I would expect Microsoft to promote the use
of both ADO and ACEDAO in the short term and aim to effectively
'deprecate' ADO for Access by significantly enhancing ACEDAO. What has
actually happened in this Access 2007 era is that the Access team has
not significantly enhanced DAO in creating ACEDAO and Microsoft (via
Access Help and MSDN) have been virtually silent on recommending DAO,
ACEDAO and ADO for anything. I don't think there is anything sinister
or surprising about this; I think they are merely sitting on the
proverbial fence, I guess because some people got *really* upset when
they favoured ADO over DAO and they don't want to make the same error
of judgment.
Personally, I say: pick and choose, mix and match, and get the best
out of the relative merits of both ADO and DAO/ACEDAO. Of course, I
will always use ADO and will never go back to DAO myself, having been
*really* upset by the whole DAO poor-teardown-model-causes-memory-leak
thing but at least you won't find me try to convert anyone said:
My first objection to ADO is that it is an ActiveX object. Perhaps I am
prejudice, but I have found ActiveX objects to be problematic.
Erm, DAO is also ActiveX compliant. Is there a subtle point I'm not
seeing?
MS
claims a simpler object model, but I don't really find that to be the case.
I don't think so. ADO is a richer model, why would MS not promote that
aspect? They usually said things like "flatter object model
hierarchy" (e.g. can create a Recordset object without first creating
an explicit Connection object") or "lightweight" (e.g. if you only
need recordsets and no replication then you can ship just ADOR library
and omit JRO library; will DAO it's all or nothing) e.g.
Dim rs As new ADOR.Recordset
rs.Open "SQL query here", "connection string here"
You'd need a few more lines to do the same in DAO. And yes, no big
deal either way.
I have also done some performance testing and found ADO does not perform as
well as DAO.
I concur. For the vast majority of cases there will be no noticeable
difference; DAO may execute a certain SQL statement 100% faster than
ADO but when the total time ADO takes is 30 milliseconds who would
care? Always using DAO on grounds of performance is known in the trade
as 'premature optimization' (pejorative).
I can open a hierarchical recordset in 300 milliseconds using ADO; I
can't open a hierarchical in DAO despite waiting seven years now and
counting said:
I don't agree <g>. We tend only to correspond when we're in
disagreement and even then it tends to be minor stuff, don't you
think?
I do respect you knowledge.
And I respect yours. BTW belated and sincere congratulations for
making MVP.
Jamie.
--