AccessDBPass



Dim sUserName As String
Dim sPassword As String
Dim db As Database
Dim ws As Workspace
sUserName = "Your Name Here"
sPassword = "Bite_Me"
' Create secured workspace

DBEngine.SystemDB = "D:\PATH\SYSTEM.MDW"
Set ws = DBEngine.CreateWorkspace("Name", sUserName, sPassword)
' That s it! Open sesame...

Set db = ws.OpenDatabase("D:\PATH\DBNAME.MDB"...)
'Note: These examples assume that you have properly secured the database

'using the Access Security Wizard. During that process, Access will create

'the SYSTEM.MDA or .MDW files mentioned above


(accessdbpass.html)- by Paolo Puglisi - Modifica del 25/3/2019