How to connect to a password protected Access Database?
Specify the password in the connection string as follows:
Dim strConn As String
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\myDB.mdb;Jet OLEDB:Database Password=yourPassword"
example: Dim con_str As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Application.StartupPath + "/db_name.mdb;Jet OLEDB:Database Password=yourPassword"