Results 1 to 5 of 5
  1. #1
    bazianm is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2013
    Posts
    9

    ODBC Connection to <dsn> failed

    Hi,



    I have an application that is running with Access 2003 under XP and it is running fine. I am upgrading it to 2010 on Windows 7 and I am getting a connection error that makes no sense. Let's me show you the code first. It's pretty simple:

    Code:
        adoJobRs.ActiveConnection = CurrentProject.Connection
        adoJobRs.Source = strSql
        adoJobRs.CursorLocation = adUseClient
        adoJobRs.LockType = adLockReadOnly
        adoJobRs.Open
    The query that resides in strSql is a valid query. I know this because I suspended the program, queried the value of the variable in the immediate window, copied it and, after the program blew up, I created a query in the database, pasted in the query and I got a result.

    The SQL is selecting data from a linked table. When I double click on the linked table, data comes up no problem.

    An error -2147467259 is generated with a description of "ODBC--connection to 'CalLab' failed."

    Clearly the DSN works else I would not get any data and all other queries work.

    Some technical information:

    1) Windows 7 64
    2) Access 14.0.7015.1000 (64 Bit)
    3) Microsoft Office Professional Plus 2010

    I have 2 DSNs setup. One in the 32 bit admin and one in the 64bit admin (for when it was running under 32 bit office).

    SQL Server 11.0.3128

    I tried this with ADO 2.8 and 6.1 (recordset is 6.0).

    Any assistance would be appreciated.

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I don't have a lot of experience in ADO. But since there has not been any replies ...

    How did you declare adoJobRs? What is strSql? Is it the name of a Stored Procedure, SQL statement, or a View?

  3. #3
    lfpm062010 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Location
    US
    Posts
    415
    Did you check your library references?

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by lfpm062010 View Post
    Did you check your library references?
    Apparently, they did
    I tried this with ADO 2.8 and 6.1 (recordset is 6.0).

  5. #5
    bazianm is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2013
    Posts
    9
    Hi.

    OK, I got this one figured out. I created a VM with Windows 7 32 bit, ran everything and it went away. I tried it using Windows 7 64 bit and Access 32 bit and I get an out of memory error. Looks like Access 2010 doesn't like Windows 7 64 in any case.

    I will make this a new thread because the topic has changed. THANKS for all your help.

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

Similar Threads

  1. Replies: 1
    Last Post: 03-02-2015, 09:44 AM
  2. Connection to SQL Server ODBC Failed
    By Historypaul in forum SQL Server
    Replies: 2
    Last Post: 01-05-2015, 01:50 PM
  3. Replies: 2
    Last Post: 01-21-2014, 11:23 AM
  4. Odbc connection to 'datasourcename' failed
    By nmcentire in forum Import/Export Data
    Replies: 1
    Last Post: 11-24-2010, 07:28 PM
  5. Replies: 2
    Last Post: 11-10-2009, 02:49 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