|
-
Aug 5th, 2000, 07:15 AM
#1
Thread Starter
New Member
Problems connecting to a password protected database
Hi,
I try to connect to a password secured database from VB but there is a problem. This is the code which I have:
pconInters.ConnectionString = _
"Persist Security Info=False;" & _
"User ID=" & strUser & ";" & "Password=" & strPassword & ";" & _
"Data Source=" & App.Path & "\Database.mdb"
pconInters.Open
Everytime when I run the code I get an error mesage: "Connection failed because of an error in initializing provider. Can't start your application. The workgroup information file is missing or opened exclusively by another user.". But the workgroup config file is in the System dir.
Before that this is what I did in Access: First I opened the database exclusively by selecting the exclusive checkbox. Then I went to Tools->Security->User and Group Accounts and I clicked on New. Then I typed a name and a personal ID. I guess that was the user name and PID for my self. I clicked Ok and Ok again. Then I went to: Tools->Security->Set Database Password and I typed my password. Then I tried to connect to the database from VB using the username and password which I just selected and I ended up nowhere as decsribed above.
Regards:
VBJ
-
Aug 5th, 2000, 08:03 AM
#2
Thread Starter
New Member
I would like to add: if anyone knows please help. This is for my assignment at school.
Thanks,
Regards:
VBJ
-
Aug 5th, 2000, 08:56 AM
#3
Hyperactive Member
You will need to add the path to the system.mdw into your connctionstring
-
Aug 5th, 2000, 09:25 AM
#4
Hyperactive Member
Jimbob - how exactly would that look in the connection string? Because I have had the same problem.
-
Aug 6th, 2000, 02:53 PM
#5
Guru
Code:
'uses ADO 2.x
Dim cn As Connection
Set cn = New Connection
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Nwindnew.mdb;Jet OLEDB:Database Password=password;"
-
Aug 7th, 2000, 01:37 AM
#6
Thread Starter
New Member
Thanks guys for your reply. Well, I will check some of the examples you posted as soon as I get back home.
Regards:
VBJ
-
Aug 7th, 2000, 08:34 AM
#7
Hyperactive Member
I've always added the path to the system.mdw, as well
a bit like this
Code:
"Provider=Microsoft.Jet.OLEDB.4.0;Password = <PASSWORD>;User ID=<USERNAME>;Data Source=<PATH TO .MDB>;Persist Security Info=False;Jet OLEDB:System database=<PATH TO SYSTEM.MDW>"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|