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 32-bit programs do not require an .INI file, nor do they require you to set the DefaultUser and DefaultPassword properties. Simply set the DBEngine s SystemDB property to point to your system database: |