Results 1 to 6 of 6
  1. #1
    crobaseball is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2014
    Posts
    128

    error, macro importing query data; Method 'DBEngine' application failed

    Having probs with a macro I'm writing in Excel. Basically, I'm trying to import data a query in Access creates, into Excel. I think it's an error where I'm not referencing the right library, but I'm not sure. Below are screenshots of the error box I'm getting, the code which is highlighted when I go to debug, and the references I have selected. Thanks!



    Click image for larger version. 

Name:	error w macro.jpg 
Views:	16 
Size:	180.6 KB 
ID:	27906

    Click image for larger version. 

Name:	highlighted code.jpg 
Views:	17 
Size:	196.4 KB 
ID:	27907

    Click image for larger version. 

Name:	References selected.jpg 
Views:	15 
Size:	191.7 KB 
ID:	27908

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    if you're going to use a DAO object you likely need microsoft DAO 3.6 object library.

    Just as a side note you *should* be able to access the database/recordset objects with microsoft access xx.x object library as well without having to use the dao.object

    i.e.

    dim db as database
    dim rst as recordset

  3. #3
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    Where's the Microsoft dao reference? You should have it


    Sent from my iPhone using Tapatalk

  4. #4
    crobaseball is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2014
    Posts
    128
    So for whatever reason, the DAO library has disappeared from my laptop. It's not listed in the reference list (I am putting a screen shot in here to show I'm not crazy; otherwise, I'd be happy to have someone point out what I'm missing). A.) How can I download this library and B.) Where should I save it?

    Thanks!!

    Click image for larger version. 

Name:	DAO library not there.jpg 
Views:	9 
Size:	168.8 KB 
ID:	27925

  5. #5
    crobaseball is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2014
    Posts
    128
    Ok, so I think I need a different file. When I look here: http://allenbrowne.com/ser-38.html
    it seems to look like I need this: C:\Program Files\Common Files\Microsoft Shared\Office14\acedao.dll
    since my access file is a .accdb type. But when I go to that folder, that .dll file doesn't exist. Any thoughts?

  6. #6
    crobaseball is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2014
    Posts
    128
    I figured it out! The "Office 14.0 Access database engine Object Library" (which I think is the library I was referring to in the previous post), can't be prioritized under the "Microsoft Access 14.0 Object Library". I simply moved the former above the latter in the priority list, and presto, my macro worked great. Here's what it should look like:

    Click image for larger version. 

Name:	reference list correct.png 
Views:	10 
Size:	299.9 KB 
ID:	27928

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

Similar Threads

  1. Replies: 9
    Last Post: 11-17-2020, 11:00 AM
  2. Replies: 3
    Last Post: 09-18-2014, 12:24 PM
  3. Runtime error 1004 - Save method of workbook failed
    By captdkl02 in forum Programming
    Replies: 2
    Last Post: 01-03-2013, 05:53 AM
  4. Replies: 1
    Last Post: 07-13-2012, 07:58 PM

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