Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

Posted

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 :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...