VBA Code connecting to sql server 2019

Anonymous
2023-07-11T14:20:06+00:00

SQL Server 2019 is installed locally. I do not understand this error

Microsoft 365 and Office | Access | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

12 answers

Sort by: Most helpful
  1. Tom van Stiphout 40,091 Reputation points MVP Volunteer Moderator
    2023-07-11T14:40:31+00:00

    This is what I meant in first instance.

    0 comments No comments
  2. Anonymous
    2023-07-11T15:24:45+00:00

    I have enabled the ports also.

    0 comments No comments
  3. George Hepworth 22,220 Reputation points Volunteer Moderator
    2023-07-11T15:30:37+00:00

    "I have enabled the ports also."

    And the result is....?

    0 comments No comments
  4. Anonymous
    2023-07-11T15:44:20+00:00

    This odbc connection works connecting to sql server 2019 but won't process vba code

    ADOConn.ConnectionString = "Driver={ODBC Driver 17 for SQL Server};Server=[CTS-LT01];Database=[CTS_Working];Trusted_Connection=yes;"

    ADOConn.Open

    0 comments No comments
  5. George Hepworth 22,220 Reputation points Volunteer Moderator
    2023-07-11T16:09:02+00:00

    You posted a screen shot of an error message, stating that a connection can't be opened. You follow with the statement that "This odbc connection works connecting to sql server 2019".

    I'm a bit confused now. When does it work? When does it not work? Obviously you are getting an error message.

    When and where is that error raised? And how do you know that the line of code posted actually does open an ADO connection in VBA?

    I suspect I know the problem and that it's been previously mentioned, but one step at a time.

    0 comments No comments