troubleshooting Question

Access 2003 switches to Windows Authentication instead of SQL Authentication

Avatar of dalevv
dalevvFlag for United States of America asked on
Microsoft Access
6 Comments1 Solution307 ViewsLast Modified:
I am trying to setup DSN-less links to a MS-SQL server using SQL authentication.  I am able to create the table links and they work during the session that I create them, but if I close and re-open the database they fail saying that "Login failed for user machine\username" - indicating that it tried to connect using Windows authentication.
I could have swore I've had this work before, but I've been unable to get it to work in this case.
Here is the code I'm using to create the links.

   Set tdfLinked = CurrentDb.CreateTableDef(strTable)
   tdfLinked.Connect = "ODBC;DRIVER={sql server};DATABASE=" & strdbName & ";SERVER=" & serverName & ";UID=" & strUid & ";PWD=" & strPwd & ";"
   tdfLinked.SourceTableName = strSourceTable
   CurrentDb.TableDefs.Append tdfLinked

Any help would be MUCH appreciated!
Dale
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 6 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros