Results 1 to 10 of 10

Thread: DAO question

  1. #1
    Join Date
    Aug 2010
    Posts
    6

    Unanswered: DAO question

    When creating a new .mdb in Access 2007 is the backend set as ADO by default? - or is it set as DAO by default?

    If it is set as ADO by default, then how do I reset it to DAO?

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Not sure what you mean by backend (in this situation), but DAO is included by default, ADO is not. That's when creating an accdb. I assume it's the same if creating an mdb, but haven't tested.
    Paul

  3. #3
    Join Date
    Aug 2010
    Posts
    6
    Thank you much

  4. #4
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    No problem, and welcome to the site by the way.
    Paul

  5. #5
    Join Date
    Oct 2004
    Location
    Melbourne, Australia
    Posts
    201

    DAO or ADO

    I may be wrong, but I always thought that whether you got an ADO database or a DAO database depended upon which VBA library you had loaded. It way well be that when you first open Access, the DAO library is the default, but I always had to go in and update the DAO library anyway as the version listed was never the latest one. Whatever, the underlying database is still Jet-powered and for most interactive operations (as opposed to programming) it probably does not matter.

  6. #6
    Join Date
    Aug 2010
    Posts
    6

    Thank you

    Thank you for your reply.

    I have gotten mixed answers to this question so I'm still unsure.
    This might be because I'm not being clear enough.
    I'm very new at this so I apologize for that.
    So I'll try to explain a bit better.

    I'm helping someone make some small changes within an existing database.
    That database was written in Access 2000 and is using the DAO library.
    Anything that I might do needs to remain compatable with that database.
    I am using Access 2007 in an Access 2000 compatability mode.
    However, I don't know if using Access 2007 in this mode makes use, by default, of ADO or DAO.

    Again, I'm getting mixed answers on this, whereas;
    Some are saying DAO, others ADO, while others say it doesn't matter.

    So, can someone tell me how I might be able to be sure?
    e.g., is there somewhere within the db that I can look, like properties, etc.? - or, is there a way to set it ADO?

    Thanks again for all of your help.

  7. #7
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    You're asking mixed questions too. Your first post specified a new database. That's different than an existing one. An existing one should carry over whatever was originally set. Where to look is in the VBA editor, Tools/References. That will tell you what's set in that particular database.
    Paul

  8. #8
    Join Date
    Aug 2010
    Posts
    6
    Thank you for your reply.

  9. #9
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    an Access database is neither DAO nor ADO.

    DAO/ADO are ways of (object libraries for) talking to Access databases - you can use either ...or both if you like, provided that you keep your declaration syntax explicit.

    e.g. with Recordset (exists in both DAO and ADO libraries) you can declare (if you have set both references):
    1. DAO.Recordset
    2. ADODB.Recordset
    3. Recordset

    1 & 2 will instantiate two completely different (and hopelessly incompatible) objects, but you can fill both of them from the same Access database (in the same subroutine if you so desire).

    3 leaves you in the lap of the Gods: the library higher up in the list of References will be used.

    izy
    currently using SS 2008R2

  10. #10
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    1,312
    Another point about defaults. If memory serves the default library switched from DAO to ADO in Access 2000. So if you wrote code like:

    Dim rstData as Recordset

    In an Access 97 database you would have gotten a DAO recordset. As of 2000 you will get an ADO recordset. But like izyrider stated, you can use both DAO and ADO recordsets in the same database project. And I would also recommend specifying the library you intend to use by including it in the declaration:

    Dim rstData as DAO.Recordset
    or
    Dim rstData as ADODB.Recordset

    That way if Microsoft adds a third technology your code should still work. Converting from 97 to 2000 was interesting because all of my declarations were Recordset and then the default changed to ADO so I had to track down all of my declarations and change them.

    It is also my understanding that Microsoft prefers that you use ADO. It is the more recent technology. And at this point (2010) I believe it is much more common to see ADO code vs. DAO code.

Posting Permissions

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