Many thanks Josef. Will look at the latest tomorrow morning.
You may want to add to the questions to Microsoft what I show in #22 above.
Yes it makes sense. In fact its what I wrote in post #23I was doing a video, per your request, when I discovered that the tables that show in the navigation pane are the linked tables that are not hidden.
Does this make sense?
I will hide the linked tables and will let you know, if they still appear. Most likely they will not appear.
Hi Josef,The problem is that with linked tables from an Access backend, you can't remove the password.
Therefore, in the example I link the tables from an unprotected backend (file path must be the same as the protected BE has later).
Set db = DBEngine.OpenDatabase(BackendPath, False, False, ";PWD=password")
Set ConnectDAO = db
subst X: Y:\our\unproteced\dummy\BE.accdb
=> file path to BE = X:\BE.accdbsubst X: /D
subst X: Y:\our\proteced\BE.accdb
'link to external MSysObjects table in database located at strFilePath
200 DoCmd.TransferDatabase acLink, "Microsoft Access", strFilePath, acTable, "MSysObjects", "MSysObjectsEXT"
'open external database so don't need to keep re-entering password (if any)
'get connection string from existing record in local MSysObjects
210 strConnect = Nz(DLookup("Connect", "MSysObjects", "Database = '" & strFilePath & "'"), "")
220 If strConnect <> "" Then
230 Set ExtDb = DBEngine.OpenDatabase(strFilePath, False, False, strConnect)
240 Else
250 Set ExtDb = DBEngine.OpenDatabase(strFilePath)
260 End If
ColinWhy can't you just have code that handles both when there is a password and when there isn't?
For example, something like this snippet from one of my apps
This is the best way. The ADODB recordsets do not have to be unbound at all.I use disconnected ADO recordsets for this purpose
Josef, while interesting, I use linked tables and cannot switch to something else right now. My software started in the DAO days and then I adopted ADO as much as possible. Hence the many references toQuery: use connection string without password => data not readable
+ open connection to backend in frontend (e. g. after user login) to allow read data from query.
Try with attached example:
1. open form 'Connect2BE' to unlock data (and relink query)
2. Open query Tab1 or Form1 => data can be read
3. close Tab1 and/or Form1
4. click disconnect in form 'Connect2BE'
5. try open Tab1 => message 'Not a valid password'
Unfortunately, you can make the password visible without knowing the password if you create a linked table in the FE while the connection to the backend is open.
I consider the automatic appending of the password to the TableDef.Connect property when linking an Access table to be a design flaw in Access.
This is the best way. The ADODB recordsets do not have to be unbound at all.
Unfortunately, you cannot use recordsets for reports.
Dim db As Database
set db = CurrentDB
Set db = DBEngine.OpenDatabase(BackendPath, False, False, ";PWD=password")
And if you forget the password, read the value of TableDef.Connect of a linked table in the frontend and you have the password again.The software works and if I try to open the BE, I am prompted for a password.
This is possible with linked ODBC data sources. I don't understand why this is not done in the same way for linked Access tables.I've asked the A-team more than once for the passwords to be removed (or at least masked) in the Connect field, particularly for ACCDE files.
I would be satisfied with connected recordsets, they don't necessarily have to be disconnected. Which should be possible in principle, since it used to work in an ADP.I use a form as a subreport to circumvent the issue that disconnected ADO recordsets were never made available for reports.
The example app I'm referring to was designed to be locked down as much as is physically possible.I would be satisfied with connected recordsets, they don't necessarily have to be disconnected. Which should be possible in principle, since it used to work in an ADP.