Article ID: 235422 - Last Review: July 28, 2004 - Revision: 3.0 How to open a password-protected database through Automation in Access 2000This article was previously published under Q235422 On This PageSUMMARY By using the OpenCurrentDatabase method, you can programmatically open a Microsoft Access database
within the Microsoft Access user interface. However, the OpenCurrentDatabase method does not provide a parameter for specifying a password for
password-protected databases. Therefore, the user is automatically prompted to
enter the database password if one exists. This article describes how to programmatically open a password-protected database in the Microsoft Access user interface without user intervention. Data Access Objects (DAO) allows you to specify a database password when opening a password-protected database. By using the DBEngine property of the instance of Microsoft Access that your code creates, it is possible to use DAO to specify the password of the database. After the database password has been validated by the Microsoft Jet database engine, you can use the OpenCurrentDatabase method to open the database in the Microsoft Access user interface without user intervention. Step-by-Step ExampleCAUTION: If you follow the steps in this example, you modify the sample database Northwind.mdb. You may want to back up the Northwind.mdb file and follow these steps on a copy of the database.
Afterward, you may want to remove the database password from the sample database Northwind.mdb. To do so, follow these steps:
REFERENCESFor additional information about opening a password
protected database with DAO, click the article number below to view the article
in the Microsoft Knowledge Base: 209953
(http://support.microsoft.com/kb/209953/EN-US/
)
ACC2000: How to Use the OpenDatabase Method to Open Password-Protected Databases
| Article Translations
|
Back to the top
