i'm trying to create a secure scenario where no one will be able to know our encrypted database passcode. BUT if they login to a form in another database successfully, it will open the encrypted database and systematically plug in the passcode thru vba (kind of like a user on a website logging into a secure SQL database i suppose). i may be going about this whole situation completely wrong but here is what i have for the code that i need to create to open the encrypted database.
- Dim appAccess As Access.Application
-
-
Sub DisplayForm()
-
On Error GoTo errorhandler
-
Dim strDB As String
-
Dim Password As String
-
Password = gg123
-
-
' Initialize string to database path.
-
Const strConPathToSamples = "\\ggserver\SharedDocs\Access DB\"
-
-
strDB = strConPathToSamples & "encryptedtest.accdb"
-
' Create new instance of Microsoft Access.
-
-
Set appAccess = CreateObject("Access.Application")
-
' Open database in Microsoft Access window.
-
-
-
appAccess.OpenCurrentDatabase strDB, "false", Password
-
-
-
-
End Sub
unfortunately, the "enter database password" still pops up when the new database opens and i have to type in the password TWICE. if i type in an incorrect password, the original code bounces back and gives me error #3031: "Not a valid password." i'm starting to wonder if by password, access means the old passwords used in access 2003 and earlier and the OpenCurrentDatabase function has nothing to do with encrypted databases. i have access 2007 and there are no such logins like that--just encrypted passwords.
so if anyone has any idea why this code is not working correctly or what an alternative might be then please let me know! thanks guys
--nate