SIMIN Posted March 23, 2008 Posted March 23, 2008 I create a connection to my access database like this: Dim StringConnection As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + "C:\Access.mdb" Dim MyConnection As New OleDbConnection(StringConnection) MyConnection.Open() ... MyConnection.Close() The question is that how can I password protect this database file "C:\Access.mdb"? Thanks. Quote
pendragon Posted March 25, 2008 Posted March 25, 2008 To password protect the access data base you need to open it with Exclusive Use, then click tools, security and set password. When that is done you need to changed your connection string to "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = C:\Access.mdb; OLE DB Services = -4; Jet OLEDB:Database Password=[your password];"; Can't remember if the OLE DB Services = -4 is needed or not, long time since I used this :) Quote
Machaira Posted March 25, 2008 Posted March 25, 2008 All you ever wanted to know about connection strings - http://www.connectionstrings.com Quote Here's what I'm up to.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.