I need help making an ado connection string from ms access to sqlexpress 15.

Sam Coburn 1 Reputation point
2022-05-28T14:49:46.333+00:00

I've been trying to figure out a connection string for a couple days now. I'm new to ado. I've been using odbc for years, but I want to update the old colde.
Please also let me know if I need quotation marks and apostrophes and does there need to be a semi-colon at the end, etc.

An example would be very helpful. I've look at connections.com, and many other places only to get

Here's a couple ones I've tried:

Set cn = "Provider='SQLOLEDB';Data Source='.\SQLEXPRESS';Initial Catalog='tblUser';Integrated Security='SSPI';"
Set cn = "Provider=SQLOLEDB; Data Source=CCI-2021\SQLExpress;Database=ADOLearn;Integrated Security=sspi;"

I'd like to use sql authentication, but windows would be fine.

Thanks!!

SQL Server | Other
SQL Server | Other

Additional SQL Server features and topics not covered by specific categories


2 answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.

    2 deleted comments

    Comments have been turned off. Learn more

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.