Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

opening a password protected database 1

Status
Not open for further replies.

ajbFL05

Programmer
Feb 21, 2005
1
US
I have created a database in access 97 and would like to make it password protected. I am calling this from a VB .net program and am unable to access the database. I am setting the password in access under tools -> security -> set database password. Am I setting the wrong password?

Here is what the code looks like

Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & "C:\mydb.mdb;Jet OLEDB:Database Password=one;"

Dim myDataAdapter As New OleDbDataAdapter(commandString, connectionString)

Dim myDataSet As New DataSet
myDataAdapter.Fill(myDataSet, "mydb")


this is the error I get

An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll

any help with this would be great

thanks
 
There is no problem with the password.
Just where is the connection.You only set the connection string, but not the connection.
You must declare the connection first, it's like:
"Dim Conn As New OleDbConnection(your_connection)"

Hope this can help you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top