This is something I put in my database to help a little more with securing my backend data. My front end I made into an mde. I placed a password on the backend mdb file and run a splash screen on startup to "on the fly" link up to the tables. I delete all linked tables when the database frontend closes.
I ran into the problem with users being able to get into the backend datasets. Something I DO NOT want at all.
Anyway, here's the code. I hope it helps someone out there!
I use (Example) to call the link table:
Call PasswordOpen("X:\SomeFolder\User.mdb", "tblMyTableName")
I ran into the problem with users being able to get into the backend datasets. Something I DO NOT want at all.
Anyway, here's the code. I hope it helps someone out there!
Code:
Function PasswordOpen(strTablePathName As String, strTableName As String) As Integer
'Standard Call for opening a password protected backend table
Dim db2 As DAO.Database
Dim ws As DAO.Workspace
Set ws = DBEngine.Workspaces(0)
Set db2 = ws.OpenDatabase _
(strTablePathName, _
False, False, "MS Access;PWD=YourPassword")
DoCmd.TransferDatabase acLink, "Microsoft Access", strTablePathName, acTable, strTableName, strTableName
Set ws = Nothing
Set db2 = Nothing
End Function
Call PasswordOpen("X:\SomeFolder\User.mdb", "tblMyTableName")