+ Reply to Thread
Results 1 to 11 of 11

Run time error -2147467259(80004005) for using ADODB.Connection

  1. #1
    Registered User
    Join Date
    03-04-2019
    Location
    Bangalore
    MS-Off Ver
    Office 2016
    Posts
    5

    Run time error -2147467259(80004005) for using ADODB.Connection

    I'm trying to connect VBA to sql server f. I'm using Windows server 2016 data center and sql sever management studio V17.3 . So I used following objects in my VBA reference
    KiSlR.png
    While I'm trying to execute below line

    Please Login or Register  to view this content.
    I'm getting error message

    Run time error -2147467259(80004005)
    Automation error,Unspecified error
    Can you guide me to resolve this error

  2. #2
    Forum Contributor
    Join Date
    06-07-2016
    Location
    Manila
    MS-Off Ver
    365
    Posts
    292

    Re: Run time error -2147467259(80004005) for using ADODB.Connection

    Check the "Microsoft Office 16.0 Access Database engine object library"

    please ignore you where trying to connect to SQL, not access.

  3. #3
    Registered User
    Join Date
    03-04-2019
    Location
    Bangalore
    MS-Off Ver
    Office 2016
    Posts
    5

    Re: Run time error -2147467259(80004005) for using ADODB.Connection

    Hi aarona, I got access to a client machine & looking like it's Microsoft Azure server. I don't have "Microsoft access" in the system. As per your suggestion, I have added the "Microsoft Office 16.0 Access Database engine object library" Please refer the screen shot.Object Reference.png.
    But still I'm getting the same error. Here is the error message
    Object Reference.png Kindly suggest
    Last edited by VBALearn12; 03-04-2019 at 06:56 AM.

  4. #4
    Forum Contributor
    Join Date
    06-07-2016
    Location
    Manila
    MS-Off Ver
    365
    Posts
    292

    Re: Run time error -2147467259(80004005) for using ADODB.Connection

    Hi, maybe you can check your firewall, check this link

  5. #5
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,903

    Re: Run time error -2147467259(80004005) for using ADODB.Connection

    What makes you think the Dim line is causing the problem?
    Rory

  6. #6
    Registered User
    Join Date
    03-04-2019
    Location
    Bangalore
    MS-Off Ver
    Office 2016
    Posts
    5

    Re: Run time error -2147467259(80004005) for using ADODB.Connection

    Hi rorya, I ran the one line code, dim statement initially. The problem got resolved now after changing the statement
    Please Login or Register  to view this content.
    .
    I'm using office 64 bit & wrote following code to pull the data from sql server
    Please Login or Register  to view this content.
    But I got following error
    Object Reference.png

    Can you guide me to resolve this issue?

  7. #7
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,903

    Re: Run time error -2147467259(80004005) for using ADODB.Connection

    On which line?

    You should never dim as new. Always use separate dim and set lines:

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    03-04-2019
    Location
    Bangalore
    MS-Off Ver
    Office 2016
    Posts
    5

    Re: Run time error -2147467259(80004005) for using ADODB.Connection

    OK rorya. I will do that. Can you please help me to resolve the execution of sql query mentioned in my previous post?

  9. #9
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,903

    Re: Run time error -2147467259(80004005) for using ADODB.Connection

    Maybe, if you answer my question about which line actually causes the error?

  10. #10
    Registered User
    Join Date
    03-04-2019
    Location
    Bangalore
    MS-Off Ver
    Office 2016
    Posts
    5

    Re: Run time error -2147467259(80004005) for using ADODB.Connection

    Quote Originally Posted by rorya View Post
    Maybe, if you answer my question about which line actually causes the error?
    Please Login or Register  to view this content.

  11. #11
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,903

    Re: Run time error -2147467259(80004005) for using ADODB.Connection

    I'd guess you either don't have a table1, don't have permissions to access it, or you need to qualify it with an owner, like dbo.Table1

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Run time error'-2147467259(80004005)':
    By baig123 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-08-2014, 12:27 AM
  2. run-time error '-2147467259(80004005)':
    By baig123 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-02-2014, 03:46 AM
  3. [SOLVED] Run-time error '-2147467259(80004005)'
    By Lloyd Blankfein in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 02-14-2013, 01:52 PM
  4. Excel 2010 Run Time Error '-2147467259 (80004005)'
    By jdpeterson72 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-06-2012, 06:52 PM
  5. [SOLVED] Run time error '-2147467259 (80004005) adding icon
    By DMc2005 in forum Excel General
    Replies: 3
    Last Post: 10-02-2005, 12:05 PM
  6. [SOLVED] Run time error '-2147467259 (80004005) adding icon
    By DMc2005 in forum Excel General
    Replies: 3
    Last Post: 10-02-2005, 12:05 PM
  7. Run time error '-2147467259 (80004005) adding icon
    By DMc2005 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-02-2005, 12:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1