Results 1 to 4 of 4

Thread: -2147467259 Unexpected Error from external database driver [Non admin user]

  1. #1

    -2147467259 Unexpected Error from external database driver [Non admin user]



    Register for a FREE account, and/
    or Log in to avoid these ads!

    I am getting this error -2147467259 Unexpected Error from external database driver when running a vba macro code at this line-.Provider = "Microsoft.ACE.OLEDB.12.0"
    in below code-

    Code:
    MyConn = _
    "Data Source=" & ThisWorkbook.FullName & ";" & _
    "Extended Properties=Excel 12.0;"
    Code:
    
    Set Cn = New ADODB.Connection
        With Cn
            .Provider = "Microsoft.ACE.OLEDB.12.0"
            .Open MyConn
        End With   
    

    This is a simple vba macro (not using .net,sql server or ms access). Only excel is used. This works fine in following combinations- Excel 2007 & Windows Xp, Excel 2007 & Windows 7. But in Windows 7 and Excel 2010 it gives this error if the user is not admin. Interestingly, in Windows 7 and Excel 2010, if i login through admin user OR RUn excel.exe by clicking "Run as administrator" option (start-typoe excel-shift +right click-run as administrator)and then opening my excel file it does not give this error and more interestingly if after logging once through admin user and opening this excel file and closing it, I then log off and log in as normal user and open my excel file I still do not get this error.So the thing is that ONE TIME login as admin and opening this excel file temporariily fixes the issue.BUT the problem is that i need to distribute this application to various users and they will be logging it as normal users and i can not ask them to first login as admin user. Why this issue is ioccuring and what is the resolution for this? It’s very urgent , will really appreciate quick response.thanks.

  2. #2
    Administrator Ken Puls's Avatar
    Join Date
    Mar 2011
    Location
    Nanaimo, BC, Canada
    Posts
    2,209
    Articles
    57
    Blog Entries
    14
    Shikka,

    My apologies, but I'm not sure I can help with the tight schedule. I'm away at the moment, with very limited time to pitch in to threads. If you can hold until Monday, then I can look at this in more detail.
    Ken Puls, FCPA, FCMA, MS MVP (Excel)

    Learn to Master Your Data at the Power Query Academy (the world's most comprehensive online Power Query training) or with my book M is for Data Monkey!

    Main Site: http://www.excelguru.ca -||- Blog: http://www.excelguru.ca/blog -||- Forums: http://www.excelguru.ca/forums
    Check out the Excelguru Facebook Fan Page -||- Follow Me on Twitter

    If you've been given VBA code (a macro) for your solution, but don't know where to put it, CLICK HERE.

  3. #3
    Seeker joseph4tw's Avatar
    Join Date
    May 2012
    Location
    South Florida, USA
    Posts
    13
    Articles
    0
    Hello, by any chance can you attach the workbook you are using? Or maybe a dummy workbook so you don't give out sensitive data?

    It sounds like you are using OLEDB to connect to the workbook itself, is that right? Do you connect to another workbook at some point?

    If you're not connecting to an external data source, I would recommend using another approach.
    Last edited by joseph4tw; 2012-06-01 at 01:20 AM.

  4. #4
    Administrator Ken Puls's Avatar
    Join Date
    Mar 2011
    Location
    Nanaimo, BC, Canada
    Posts
    2,209
    Articles
    57
    Blog Entries
    14
    Oh man, sorry Shikha! I just realized that I never did get back to you on this. Joseph, thanks for reviving the thread!
    Ken Puls, FCPA, FCMA, MS MVP (Excel)

    Learn to Master Your Data at the Power Query Academy (the world's most comprehensive online Power Query training) or with my book M is for Data Monkey!

    Main Site: http://www.excelguru.ca -||- Blog: http://www.excelguru.ca/blog -||- Forums: http://www.excelguru.ca/forums
    Check out the Excelguru Facebook Fan Page -||- Follow Me on Twitter

    If you've been given VBA code (a macro) for your solution, but don't know where to put it, CLICK HERE.

Posting Permissions

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