Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Atlanta, Georgia, USA
    Posts
    274
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Reference Order (Access2000/2003)

    I have a database(A2000 format) that I created in Access 2003 and it has a reference to Microsoft DAO 3.0 Object Library.
    It is the third reference in the list.
    If I zip the file and move it to a PC with Access 2000 and unzip it, the database works fine and the references are there and in the same order.
    When I modify some code and then compile it, then zip it ,and move it back to the PC with Access 2003, the Microsoft DAO 3.0 Object Library reference is at the bottom of the list.
    The database won't run correctly until I move the reference back to its third place in the list.
    What causes this and is there a way to programatically move references?

    Thanks,
    Scott

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

    Re: Reference Order (Access2000/2003)

    Why would you have a DAO 3.0 reference in an Access 2000 database? The DAO library for 2000 and above is DAO 3.6. The order doesn't matter if you properly declare you object variables as DAO.Recordset or ADODB.Recordset, and so forth.
    Charlotte

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

    Re: Reference Order (Access2000/2003)

    Some problems with the DAO library can be solved by making all declarations explicitly refer to either DAO or ADO, in particular for Recordset, Field and Index objects: either use

    Dim rst As DAO.Recordset

    or

    Dim rst As ADODB.Recordset

    If you just declare

    Dim rst As Recordset

    it will be DAO or ADO depending on which reference comes first, so code may fail.

    BTW, the only way to "move" a reference is to delete the references above it (except for those to VBA and Access, they cannot be removed), and add them again. Theoretically, this can be done in code, but I have never had much success with that.

  4. #4
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Atlanta, Georgia, USA
    Posts
    274
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Reference Order (Access2000/2003)

    Charlotte,
    It was a typo. It is 3.6. I'll try declaring them as you and Hans indicate.
    Thanks

Posting Permissions

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