Cardinals28
Cardinals28

Reputation: 11

Protecting Access Database

Looking for a solution to protecting an access database. I want a user to be able to read and write to it via a vb.net program but when a user goes to the location of the database, on a network folder, they cannot interact with it there.

I know I can password protect the database and include the password in the connection string but with enough effort would the user be able to find said password in the program's files once installed on their computer?

Thanks in advance.

Upvotes: 0

Views: 239

Answers (2)

Gustav
Gustav

Reputation: 56006

As already mentioned by Marc B, you can add some twists and that's it. It will only be bumps, not real security.

The simple and effective solution is to move your data to a server based database engine with true security. As you use VB.NET, the natural choice would be the free SQL Server 2014 Express.

Upvotes: 1

user1234433222
user1234433222

Reputation: 996

Try this, It might not work however it is worth a try before setting up something new, i was thinking since you mentioned that the file is on a network why not try and encrypt the file each time the program closes? that way if a another user was to locate it on the network on another computer they shouldn't be able to access it.

Private Sub Form1_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing
    Dim FileLocation As String = "C:\Users\" & Environment.UserName & "\Documents\Database1.accdb"
    IO.File.Encrypt(FileLocation)
End Sub

If you wanted to decrypt the file, just replace encrypt with decrypt. Also add a password from access as mentioned above. This is about all you can do I believe, let us know how you get on.

Upvotes: 0

Related Questions