Home > How-To Library > Database

How to set, open, and change a password in an Access database using DAO.

**************************************************************** * © 2007 CodeItBetter http://www.codeitbetter.com * * This notice MUST stay intact for legal use * ****************************************************************
'Code for setting database password Dim db As Database Set db = OpenDatabase("your_path", True) 'Set new password db.NewPassword "", "your_new_password" db.Close '----------------------------------------------------- 'Code for opening a password protected database Dim db As Database Set db = OpenDatabase("your_path", False, False, ";pwd=your_password") '----------------------------------------------------- 'Code for changing a database password Dim db As Database Set db = OpenDatabase("your_path", True, False, ";pwd=your_password") db.NewPassword "old_password", "your_new_password" db.Close

If you would like to submit your code here please us. Do not forget to mention your name. We are always thankful to each and everyone of you who submitted their code here.