Click here to Skip to main content
15,894,740 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
i have table on ms.access encrypted with password. when i try to open it using vb.net, it can be accessed. i have tried code from connectionstring.com. i'm using ms.access 2013 and visual studio 2012
is there any suggestion, please?
this my basic code for connection when the ms.access is not encrypted.

VB
Dim kns As New OleDbConnection("provider=microsoft.ace.oledb.15.0;data source =" & Application.StartupPath & "\database.accdb")
    Dim da As New OleDbDataAdapter
    Dim ds As New DataSet
    Dim sql As String
Posted

1 solution

You need to define the database password if the database is encrypted. For example:
VB
Dim kns As New OleDbConnection("provider=microsoft.ace.oledb.15.0;data source =" & Application.StartupPath & "\database.accdb;Database Password=PasswordGoesHere")
 
Share this answer
 
Comments
vendir 25-Jan-15 6:57am    
i have tried that and it shown error on my sql command. it said "Could not find installable ISAM." when i run it with no password access, it can work. or did i have to edit my code too?

Sub CARIUSER()
DS.Clear()
SQL = "SELECT * FROM userlist WHERE Username ='" & USERNAME.Text & "'"
DA.SelectCommand = New OleDbCommand(SQL, KNS)
DA.Fill(DS, "userlist")
End Sub

it shown error on da.fill
Wendelius 25-Jan-15 7:15am    
As far as I know that error message is related to dbase, foxpro and other ISAM based files, not Access.

Have you tried using a different provider:
microsoft.ace.oledb.12.0

Also if you have 64 bit environment make sure that you have the 64 bit drivers installed correctly.
vendir 25-Jan-15 8:33am    
if i using microsoft.ace.oledb.12.0 that mean i have to change my access file to mdb?
Wendelius 25-Jan-15 10:35am    
No, as far as I know you can use version 12 with accdb files
vendir 25-Jan-15 23:08pm    
it gave the same error
Could not find installable ISAM.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900