Results 1 to 7 of 7

Thread: Problems connecting to a password protected database

  1. #1

    Thread Starter
    New Member
    Join Date
    May 1999
    Posts
    6

    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


  2. #2

    Thread Starter
    New Member
    Join Date
    May 1999
    Posts
    6

    I would like to add: if anyone knows please help. This is for my assignment at school.

    Thanks,

    Regards:
    VBJ

  3. #3
    Hyperactive Member
    Join Date
    Apr 2000
    Location
    Isle of Man
    Posts
    276
    You will need to add the path to the system.mdw into your connctionstring

  4. #4
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Columbia, SC USA
    Posts
    374

    Question

    Jimbob - how exactly would that look in the connection string? Because I have had the same problem.

  5. #5
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    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;"

  6. #6

    Thread Starter
    New Member
    Join Date
    May 1999
    Posts
    6

    Thanks guys for your reply. Well, I will check some of the examples you posted as soon as I get back home.

    Regards:
    VBJ

  7. #7
    Hyperactive Member
    Join Date
    Apr 2000
    Location
    Isle of Man
    Posts
    276
    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
  •  



Click Here to Expand Forum to Full Width