- Local time
- Today, 06:15
- Joined
- Feb 19, 2002
- Messages
- 47,029
Don't save the password with the linked table
As I suggested, this is only partly an IT problem....Well one time, I linked to a clocking machine system table and changed my credentials to admin and I was able to make changes to the clock in/out data.
The IT Department controls were sub-par at best.
Where can I find some tutorials?You can always link the tables on the fly with credentials and use dsn-less tables. and a sql auth account
You can open a blank database, from vba create an Access object, open the database, loop through table def and read their connect string. Which takes us back to first point. If You can not hide the password, then I don’t see how Pat’s method can help.I don't really see people being able to get that connect string,
I've been looking for the code. I haven't watched the videos George posted but they might have the answer. When I had to solve this problem, I used code that logged into the server separate from the table links which did not include the password. Once I was logged in, the links without the password were fine.then I don’t see how Pat’s method can help.
Pat's approach seems to be basically the one demoed back then, although in retrospect my demo was a bit crude, IIRC.I've been looking for the code. I haven't watched the videos George posted but they might have the answer. When I had to solve this problem, I used code that logged into the server separate from the table links which did not include the password. Once I was logged in, the links without the password were fine.
Alternatively, if you hide the linked tables they cannot be seen by other databases so you cannot see the connection strings.
That's the only portion of your post I disagree with.Otherwise it’s too much trouble for no additional security
The way I would do it is to create and run a "pilot" passthru query in VBA, using credentials stored in the VBA. That establishes the connection as you describe it. As long as the connection is complete, it stays alive during that session.
Not my idea originally. Ben Clothier wrote a blog post about it a long time ago. (I'd go find it again, but <reasons for being lazy go here>.)Great idea George! You can create and drop querydefs on the fly too. And the VBA project will be pw protected, plus it could be accde, so...
Can you elaborate on the tricks?Note to temp query def and SQL auth user:
As soon as a linked table is opened in the FE, the password can be read out again (with a few “tricks”).
=> Windows Authentication is the most secure option for me. (I can assign the rights specifically to AD users or AD user groups.)
In most of my databases, I have some queries called qryBucket, which just means "this is a container into which vba can through .sql property values into whenever it needs to", very handy!Not my idea originally. Ben Clothier wrote a blog post about it a long time ago. (I'd go find it again, but <reasons for being lazy go here>.)
It's the most secure and preferred method from the dba's perspective and most everyone else's, Yes,,, until you introduce microsoft Access into the picture, and you give your company the impression that "don't worry, my app is the only way people will be able to mess with this data" - at that point, windows auth starts to look pretty bad.Windows Authentication is the most secure option for me. (I can assign the rights specifically to AD users or AD user groups.)
I went aAlso, Kite, I'm not sure you're right about those steps you listed.
Can you really open up a blank database, use vba to open an accde, and get its connect strings? Maybe, but only while they also have the other app open, since you'd drop those connections upon close. The whole thing is pretty well obfuscated. They would have to be very knowledgeable and know how you were doing it to even be turned on to the possibility of that method. It's far more obfuscated (and thus a bit more secure) than just giving them full unrestricted access to your sql tables via Windows Authentication..
After reviewing the video, I remembered that the first part of it involved the user knowing the UID and PWD, which is an alternative situation. That would not work for the user who is willing to bypass any legitimate approach and connect to the database from another accdb or via Excel, etc.Pat's approach seems to be basically the one demoed back then, although in retrospect my demo was a bit crude, IIRC.
The way I would do it is to create and run a "pilot" passthru query in VBA, using credentials stored in the VBA. That establishes the connection as you describe it. As long as the connection is complete, it stays alive during that session. And, if the passthru is deleted or not saved at all, it can't be used to retrieve the connection string.
You can password protect the VBA project itself even before creating an accde. Run from an accde, it should hide the credentials from all but the most determined and knowledgeable hacker. They'd have to inspect the binary in the accde to find the credentials, which I'm not even sure is possible anyway if it's been password protected.
Anders mostly talked about securing the database from the SQL Server side, but it's seminal stuff.
You can un-hide the tables from an external database too.Alternatively, if you hide the linked tables they cannot be seen by other databases so you cannot see the connection strings.