"Jack Hudson" <(E-Mail Removed)> wrote in message
news:jJXOh.10269$(E-Mail Removed)...
> For years now MS has suggested using ADO as DAO is obsolete. However, I
> still see MVP's giving code solutions using DAO. Not being critical here,
> simply curious to know why ADO solutions are not given more frequently.
> Any observations y'all like share?
>
> Regards, Jack Hudson
>
ADO was a newer object model, and is not really tied to JET.
In some ways, the ADO object model is a bit cleaner then DAO. (the two areas
that I notice the most is are when you do a update in ADO, the record
pointer does not move...in DAO it does, and that tends to be a bit of pain
(actually quite a bit of pain). Also, in ADO if you move to the next record,
you don't have to issue a update, were as in DAO you do. And, if memory
servides me correct, the "edit" method is optional in ADO. These about the
only two, or three real things as to why I think ADO is a bit cleaner then
DAO.
However, it is ADO that really be put out to pasture, and we are now being
told to use ado.net.
However, for ms-access, we continue to receive new versions of JET..and
access 2007 has new data types. So, in effect, DAO continues to get
enhancements and new features (if you consider DAO as part of the jet
engine). ADO it not receiving any such enhancements.
In access 2007, the JET odbc direct ability was removed. So, this means that
JET is still being changed, and this is one example of a feature that has
been put to pasture. This issue does favour using ADO in this case (as then
you can connect to sql server, and by-pass jet. However, jet + odbc via dao
still functions as usual, and pass-though queries will still by-pass jet,
and thus you get much the same result.
In addtion, workgroup secirty for access 2007 has been removed. So, in
effect, this is two areas which reduce the advantage of using DAO over that
of ADO.
However, in both cases, dao, or ado hitting sql server perform about the
same.
so, in a funny way, about 7 years ago, we were told to use ADO, but we all
just continued on using DAO. As time passed, lo, and behold...today, DAO is
still strong, and in the ms-access community DAO is stronger then is ADO,
and DAO still enjoys good support from Microsoft.
So, it likely more developers are dropping ADO and moving to ADO.NET then we
who continue to use DAO.
If your developing the application in mind with eventual moving to sql
server, then there is some advantages to using ADO in your application. And,
we have a good number of vb6 developers who now jumped into ms-access, and
they are also more familiar with ADO. So, what is really nice is that both
dao, and ado enjoy widespread support in ms-access. For the most part those
being told to throw out, and stop using DAO were actually a bit
miss-informed.
It is not really much a problem or issue, DAO tends to be the choice when
building ms-access application (because that is the way we always done
it..and it tends to be a bit less code in a good number of cases -- sans my
two examples).
You certainly can use ADO also. ADO is another layer on top, and does
abstract out the database more then DAO. So, if you eventually plan to
change the database engine, ADO is still a better choice.
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
(E-Mail Removed)