Avatar of NNOAM1
NNOAM1
Flag for Israel asked on

Issue with a cached connection from Access to SQL

Hello dear friends.
Recently I've tried to follow the instructions regarding "Cached connection", described in this article:
https://www.microsoft.com/en-us/microsoft-365/blog/2011/04/08/power-tip-improve-the-security-of-database-connections/
and indeed - the "miracle" did happen:
All my linked tables from Access to SQL Server now have a connection string which doesn't reveal anything about the username & password. Tables use the cached connection which has been prepared when the application was opened.

Now I have to include in this Access application some tables which reside in another database, on the same SQL Server. They won't use the cached connection.
1. Is there a way to create another cached connection for these new tables? without "harming" the first cached connection?
2. If these tables use a different connection string (so they won't use that cached connection) - is it going to "harm" the cached connection used for the old tables in any way?

Thank you very much!
DatabasesMicrosoft AccessMicrosoft SQL ServerSQL

Avatar of undefined
Last Comment
NNOAM1

8/22/2022 - Mon
Gustav Brock

1. You can create DSN-less connections (which is what this old blog is about) to one or more databases
2. They don't "see" each other.
NNOAM1

ASKER
Yes, Gustav, from the beginning this was done DSN-less. This isn't a problem. I've been creating DSN-less connections for years.
But this time the idea of Cashed Connection was implemented for the first time. All tables connect to SQL via this cashed connection. What will happen when we want to have another cashed connection for the tables linked to the other SQL database?
Gustav Brock

I guess that Access, of those connections created, will use that cached connection that matches the server address/hostname and the database name. Should be easy to check out.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
Jim Dettman (EE MVE)

The other option (and a better one), is to use trusted connections to SQL.   That way, you avoid the whole username/password problem.

Jim.
NNOAM1

ASKER
In this company, we're allowed to use SQL Server Authentication only.
John Tsioumpris

Maybe its better to use DSN-less connections with UserName/Password and focus more on the user Permissions/Accessibility...if you tighten up which user has access to which table and work on this you could have all the tables without trying to trick the system...
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
Jim Dettman (EE MVE)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
NNOAM1

ASKER
Yes, multiple domains. Thank you all for your help.