If you use the ODBC Wizard on the new machine, are you able to get a successful connection?
MSAccess vba dsnless connection to sql server; password issues
I am trying to create a DNSless connection to an SQL server we host that is managed by someone else. I want to be able to create an accde front end so others on the network can run reports I’ve designed in modules I’ve created in vba, from data on said sql server. Here’s what I have so far:
I created an ODBC 32 bit file DSN connection to the sql server and for the authentication, chose ‘With SQL Server authentication using a login ID and password entered by the user’.
I then created a linked table in MSAccess to this table. As it is not a trusted connection, it asked me to log in. I was able to open the table and see the data.
If I close MSAccess, then reopened the database and tried to look at the table or run a vba query, I’m asked for a password again. It defaults to my windows user id.
So… I found how to edit the file dsn and add the password (already had the user name). I opened the file with notepad and added the info. When I open the file dsn via the odbc data source administrator, looks good (a password is there)!
I build a new linked table in msaccess and used the new connection with the password. No prompt when building the link. And I can open the table without a password!
I exit MSAccess and reload the database. Now I am prompted for the user id & password, defaulting to my windows id. Grrr!
How can I automate logging in to the sql server so that the users (or any scheduled reports that run) do not have to enter that user id?
Microsoft 365 and Office Access Development
8 additional answers
Sort by: Most helpful
-
DBG 2,381 Reputation points Volunteer Moderator
2021-05-24T13:29:46.43+00:00 Hi. That is correct. When you use a File DSN to connect to a server, Access converts it into a DSN-less connection. What does the error message for 3151 say?
-
Connie S 21 Reputation points
2021-05-24T13:34:03.02+00:00 ODBC connection failed
-
Connie S 21 Reputation points
2021-05-25T11:23:14.977+00:00 I am not. Tried copying my file dsn to this machine and it said it was invalid. Tried setting up a new one and could not find the server.
Thanks for your help! I will reach out to the network administrator and see what's up.
-
DBG 2,381 Reputation points Volunteer Moderator
2021-05-25T16:34:37.847+00:00 Okay, good luck. Sounds like it may be a network issue.