none
Excel ODBC connection to SQL Server fails on some workstations RRS feed

  • Question

  • Environment:

    SQL Server: 2008 R2 on Windows 2008 R2

    Office: 2010 Pro 64-bit Using Excel VBA

    Workstations:  some Windows 7 some Windows 10

    In all cases when the 64-bit ODBC was set up the link tested successfully.

    We have several Excel spreadsheets that connect to SQL databases using ODBC connections.  This works fine on Windows 7.  It fails on a different Windows 7.

    On a third Windows 7 computer that used to work but was upgraded to Windows 10 it no longer works.

    In all cases we get Login Timeout errors.

    I have verified that Office is 64 bit and ODBC is 64 bit.  Any ideas how to track this down?


    Wednesday, October 19, 2016 7:15 PM

All replies

  • Me again:  Note, we are using Excel 2010 VBA.
    Wednesday, October 19, 2016 7:17 PM
  • Hi,

    Please provide the code you use to create connection first.

    Then I will move this thread to Excel for Developer forum:

    https://social.msdn.microsoft.com/Forums/en-US/home?forum=exceldev

    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.


    Regards,
    Emi Zhang
    TechNet Community Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Thursday, October 20, 2016 5:53 AM
  • Hi,

    What VBA code are you using now? Do you try to manually connect?

    According to your description, only the specific computer using win10 which upgraded from win7 does not work.

    Are there any other computers upgraded into win10? Do they work?

    If all the computers which upgraded into win10 fail, do you try to uninstall the upgrade and does it work again?

    If only there is only one un-workable computer, do you check the office specific version between them?

    Thanks for your understanding.

    Regards,

    Celeste 

    Monday, October 24, 2016 8:11 AM
    Moderator
  • Sorry this is so late in response.  We have a mix of Win 7 and Win 10 computers.  All computers are 64 bit machines.  All but one is using 64 bit Office 2010.  Only one works, Win 7.  This is the one upon which I develop the VBA code.

    On all machines I can create the ODBC DSN and successfully test within the ODBC manager.  However, the VBA code times out when running the Code to establish the code.  Following is the code used in the programs:

    '
    Sub LogIntoCW()
        LoginFailed = False
        On Error GoTo NotConnected
    '
        luserid = "xx"
        lsqlpassword = "xxxxxx"
        lintercompanyid = "xxxxxx"
        lsqldatasourcename = "CW"
        '
        ' Create the ADO_connection object and then open it
        '
        With ADO_con
            .ConnectionString = "DSN=" + lsqldatasourcename + _
                                ";UID=" + luserid + _
                                ";PWD=" + lsqlpassword + _
                                ";DATABASE=" + lintercompanyid
            .CursorLocation = adUseClient
            .Open
        End With

        ADO_cmd.ActiveConnection = ADO_con
        ADO_cmd.CommandType = adCmdText
        On Error GoTo 0
        Exit Sub
    NotConnected:
        LoginFailed = True
        MsgBox "    Data Source=" + lsqldatasourcename _
             , vbCritical, "Login to CW failed"

        On Error GoTo 0
        End
    End Sub

    Wednesday, January 4, 2017 9:51 PM
  • We are still waiting for an update to this issue.  I last talked to someone on Thursday Jan 5 and shared the desktop on two computers.  One that works and one that didn't.  The person created log files of the processes running in Excel on each and as instructed I sent the to Microsoft.

    Please.  This is an urgent issue and we need resolution on our computers!

    Regards,

    Bill Colbert

    Wednesday, January 11, 2017 6:51 PM
  • Hi,

    Sorry that we are unable to reproduce your issue.

    Since the issue is urgent and due to the limitation of the community support channel, I will suggest you contact the Microsoft professional support so that our engineers can work closely with you to troubleshoot this issue.

    If the support engineer determines that the issue is the result of a bug, the service request will be a no-charge case and you won't be charged.

    Please visit the link below to see the various paid support options that are available to better meet your needs.  

    http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone

    Thanks for your understanding.

    Regards,

    Celeste

     


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, January 16, 2017 2:49 AM
    Moderator