Can not connect to a MS Access database with a pas

Stolenfinche

New Member
I can not open a connection to a MS Access database if it has a password. <BR><BR>Code in VB.NET:<BR><BR>sConnString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source="<BR> sConnString = sConnString & Mypath & "mydatabase.mdb; User Id=Admin;password=mypassword;" & _<BR> "Persist Security Info=False;"<BR><BR> 'Create the connection <BR> oConnection = New OleDbConnection(sConnString)<BR><BR>Error:<BR>Cannot start your application. The workgroup information file is missing or opened exclusively by another user. <BR><BR><BR>If the database does not have a password it works fine.<BR><BR> sConnString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Mypath & mydatabase.mdb;" _<BR> "Persist Security Info=False;"<BR><BR> 'Create the connection <BR> oConnection = New OleDbConnection(sConnString)<BR><BR>What are the steps to connect to a MS Access database that has a password?<BR><BR>Where can I go to get more information?<BR><BR>Thank you<BR>AaronI got the answer from microsoft office newsgroup Access.<BR>Douglas J. Steele gave me an reply that I could only had to slightly modify to get to work.<BR><BR>My database only has a password. It has no users with passwords.<BR><BR>sConnString = "Provider=Microsoft.Jet.OLEDB.4.0;" _<BR>& " Data Source="c:somepathmydb.mdb;" & _<BR>& "Jet OLEDB:Database Password=MyDbPassword;"<BR><BR><BR> 'Create the connection <BR> oConnection = New OleDbConnection(sConnString) <BR><BR>I hope this helps others. It sure solved my problem.<BR><BR>AaronI found this link at ms : http://office.microsoft.com/assistance/2002/articles/waystoworkwithsqldata.aspx
 
Back
Top