Results 1 to 8 of 8
  1. #1
    jo15765's Avatar
    jo15765 is offline Expert
    Windows 7 Access 2000
    Join Date
    Nov 2010
    Location
    6 Feet Under
    Posts
    672

    Dim DAO as DB Erro

    I am getting this error when I try to run the Dim DAO as DB:



    user defined type not defined

    I have installed the Microsoft ActiveX Data Objects 2.8 but still getting the error?

    Anyone have suggestions?

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,847
    What exactly are you trying to do?

    Dim db as DAO.Database is correct syntax, but you have to make sure you have the DAO library referenced.

  3. #3
    jo15765's Avatar
    jo15765 is offline Expert
    Windows 7 Access 2000
    Join Date
    Nov 2010
    Location
    6 Feet Under
    Posts
    672
    trying to access another database to pull in specific form/queries, or export forms/queries from my current db to another db.

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,847
    You have to do it in code?
    You can open the second database, then do the GetExternalData, Import from your original database. Pretty straight forward if you just want to create a new DB.
    Last edited by orange; 06-23-2011 at 11:08 AM. Reason: spelling

  5. #5
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    You do not use DAO as a variable name.

    Dim db As DAO.Database

    (as shown by orange is correct)

  6. #6
    jo15765's Avatar
    jo15765 is offline Expert
    Windows 7 Access 2000
    Join Date
    Nov 2010
    Location
    6 Feet Under
    Posts
    672
    If I use Dim db As DAO.Database I still get the same error. My next ?, is this code required to perform these operations?

  7. #7
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Quote Originally Posted by jo15765 View Post
    If I use Dim db As DAO.Database I still get the same error. My next ?, is this code required to perform these operations?
    1. Yes, it is.

    2. You posted that you
    I have installed the Microsoft ActiveX Data Objects 2.8 but still getting the error?

    But that isn't the right thing. That is ADO not DAO and for DAO you would need to set the reference to

    Microsoft DAO 3.6 Object Library

  8. #8
    jo15765's Avatar
    jo15765 is offline Expert
    Windows 7 Access 2000
    Join Date
    Nov 2010
    Location
    6 Feet Under
    Posts
    672
    Well, I'll be a monkey's uncle! That fixed it, thanks!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Runtime Erro will not install
    By drunkinmunki in forum Access
    Replies: 4
    Last Post: 12-16-2010, 06:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums