Results 1 to 11 of 11
  1. #1
    New Lounger
    Join Date
    Feb 2003
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ADO or DAO (Access 2000)

    I am in charge of developing a db at my office. We are currently running Access 2000 and Windows 98. I have heard rumors that in the next year or so everything will switch over to XP. I have been basically teaching myself, and before I dive into this headfirst, I'd like to know where I should focus my time...on learning ADO or DAO. The book I'm reading (Roger Jennings Special Edition Using Access 2000) seems to follow the line that ADO is the way to go...anyone have any opinions? I am just learning this Access/VBA thing, so please forgive me if your answers/opinions lead to more questions on my part.

    Thanks for your time.
    <img src=/S/butterfly.gif border=0 alt=butterfly width=15 height=15> Sarah

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: ADO or DAO (Access 2000)

    Well, DAO is officially defunct, which means it will no longer be updated or expanded. However, the two object models really do somewhat different things. If you are using an MDB, you're still going to need DAO in both Access 2000 and Access XP. If you work with ADPs, it's ADO all the way. I know that doesn't really answer your question, but if you continue to work with A2k or AXP, you're going to need DAO. On the other hand, learn at least the basics of ADO because that will give you some tools you don't have with DAO, like disconnected recordsets and persisted recordsets, etc. DAO is optimized for Jet, so it is faster in many cases than ADO. ADO, however, works on any kind of data, so it is more flexible than DAO. Just try to use the best tool for the need.
    Charlotte

  3. #3
    New Lounger
    Join Date
    Feb 2003
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ADO or DAO (Access 2000)

    Thanks Charlotte for your quick answer! So I can mix ADO and DAO in one MDB?

    Thanks again,
    Sarah

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: ADO or DAO (Access 2000)

    Yes, you can mix ADO and DAO, but you must take care to distinguish between the two. Field and Recordset are objects in both models, so if you declare Dim rst As Recordset, you might not get the results you expected. Always prefix such objects with either DAO or ADODB:

    Dim rst As DAO.Recordset

    or

    Dim fld As ADODB.Field

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: ADO or DAO (Access 2000)

    In addition to Hans's advice, be careful not to try to mix the two object models. You can't use them in the same routine, and it's safest not to try and call ADO routines from the middle of a routine using DAO and vice versa. The symptoms are quite obvious when you do--the database closes without an error message and dumps you back to the Windows interface without any warning at all.
    Charlotte

  6. #6
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: ADO or DAO (Access 2000)

    Also note that we have a database someone was developing where both DAO and ADO were mixed. However, as Hans and Charlotte noted you must be very careful in keeping the syntax correct. In this particular database, you received numerous errors when compiling for the lack of designating the the correct reference. The database was scrapped for a new one due to too many programming irregularities (besides the fact it was not user friendly...)
    Regards,

    Gary
    (It's been a while!)

  7. #7
    New Lounger
    Join Date
    Feb 2003
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ADO or DAO (Access 2000)

    Thanks very much. I will move carefully!

    Sarah

  8. #8
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: ADO or DAO (Access 2000)

    One other observation - the ADO capabilities provided with Access 2000 are rather limited compared to DAO. The situation improves considerably in Access 2002, so if you really want to explore ADO, you might want to upgrade to it or the next version.
    Wendell

  9. #9
    2 Star Lounger
    Join Date
    Nov 2001
    Location
    London, UK, England
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ADO or DAO (Access 2000)

    Just my 2 cents.....I find when using Access as a Back End it's much easier to stick with DAO. It's a specifc object model for Access and has all the functionality you're likely to need regarding table defs, querydefs & indexes - all in the one location.

    ADO offers the connection & recordset objects etc, but if you want to start manipulating tables you need to specifiy an additional reference to ADOX....and if you want to incorporate database compaction, DB Password maintenance etc... you need to reference JRO (Jet Replication Objects). Why not stick with the one model, much easier!!

  10. #10
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: ADO or DAO (Access 2000)

    Well, you'll need ADO at some point, so it's a good idea to at least learn the rudiments now. Granted, ADO.Net and ADO are not the same, but since both are so different from DAO while retaining enough similarities to confuse a developer, it makes sense to start getting acquainted before it's absolutely necessary. <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>
    Charlotte

  11. #11
    New Lounger
    Join Date
    Feb 2003
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ADO or DAO (Access 2000)

    Thanks again for your insight! As a newbie, I'm drawn to what seems to be the less complicated (relatively) DAO, but I'll make sure to not skill over these chapters about ADO. <img src=/S/brainwash.gif border=0 alt=brainwash width=15 height=15>

    Sarah

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •