Results 1 to 15 of 15

Thread: Access Access database

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Nov 2001
    Location
    Trying to reach and stay in the cloud
    Posts
    2,089

    Arrow Access Access database

    how does one open a access database using ADODB which is protected with a password.

    I know that u use some - conn.properties method - but I dont want to do it that way. any other way perphaps????

    Also when I do try to open it then it informs me that the database shd have exclusive permissions

    how do I do that??

  2. #2
    AIS_DK
    Guest
    Exclusive permision means, that no other program can use the database, while your program uses it, so you can't have it opened in ie. Access.

    Under the ADODB.Connection object, in the code, where you open the db, add this line of code before you try to open the DB

    .Properties("Jet OLEDBatabase Password") = "DATABASEPASSWORD"

    Change DATABASEPASSWORD with the DB password.

    That should do it.

  3. #3
    AIS_DK
    Guest
    %&¤#!%&# Smilies

    Should have been

    .Properties("Jet OLEDB:Database Password") = DATABASEPASSWORD

  4. #4

    Thread Starter
    PowerPoster
    Join Date
    Nov 2001
    Location
    Trying to reach and stay in the cloud
    Posts
    2,089

    Question I am getting this error:



    The workgroup information file is missing or open exclusively by another user
    The file is not open by any other user!!!!!!

  5. #5
    Fanatic Member dongaman's Avatar
    Join Date
    Aug 2001
    Location
    xi'an
    Posts
    616
    Access97 or Access2k DB?
    I am just aman.

  6. #6

    Thread Starter
    PowerPoster
    Join Date
    Nov 2001
    Location
    Trying to reach and stay in the cloud
    Posts
    2,089

    hi

    Access 2k.

  7. #7
    Fanatic Member Slaine's Avatar
    Join Date
    Jul 2002
    Posts
    641
    Sounds like the database is protected by User Level Security.

    In this case you will also need to put the following in you code before you open the database:

    .Properties("Jet OLEDB:System database") = SYSTEMDATABASE
    .Properties("User ID") = USERNAME

    Replacing SYSTEMDATABASE with the full name and path of the system database (.mdw file) and USERNAME with the name of the user with the correct access rights. You would then replace the DATABASEPASSWORD with this users password.
    Martin J Wallace (Slaine)

  8. #8

    Thread Starter
    PowerPoster
    Join Date
    Nov 2001
    Location
    Trying to reach and stay in the cloud
    Posts
    2,089

    Thanks

    thanks a lot.

    But now I am getting "Invalid password error"


    So I switched back to the previous code i.e
    without this stm :

    .Properties("User ID") = USERNAME


    Then to I am getting the same error - invalid password.

    Now what shd I do?

  9. #9
    Fanatic Member Slaine's Avatar
    Join Date
    Jul 2002
    Posts
    641
    If you can send a sample of the code and the database I will have a look at it for you.

    Either post it on here or email it to me.
    Martin J Wallace (Slaine)

  10. #10

    Thread Starter
    PowerPoster
    Join Date
    Nov 2001
    Location
    Trying to reach and stay in the cloud
    Posts
    2,089

    hi

    I pasting the code here.

    Code:
    Dim conn As New ADODB.Connection
    Dim rs As New ADODB.Recordset
    
    
    Dim mstr As String
    mstr = App.Path & "\Library.mdb"
    With conn
        conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data source=" & mstr
        conn.Properties("Jet OLEDB:Database Password") = "12345"
    End With
    The exact error is :

    Code:
    Run Time error -21....
    
    Not a valid password
    Then it highlights the .open Line.

  11. #11
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    VB Code:
    1. conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\TEST.MDB;Jet OLEDB:Database Password=SecretPass"
    -= a peet post =-

  12. #12

    Thread Starter
    PowerPoster
    Join Date
    Nov 2001
    Location
    Trying to reach and stay in the cloud
    Posts
    2,089

    Thanks a lot peet

    It works now.

    But just for my knowledge can u tell me why didnt work before?

  13. #13
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    did u ever try switching the sequense?
    assign password before opening the connection?

    try


    VB Code:
    1. Dim mstr As String
    2. mstr = App.Path & "\Library.mdb"
    3. With conn
    4. conn.Properties("Jet OLEDBatabase Password") = "12345"  
    5. conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data source=" & mstr    
    6. End With
    -= a peet post =-

  14. #14

    Thread Starter
    PowerPoster
    Join Date
    Nov 2001
    Location
    Trying to reach and stay in the cloud
    Posts
    2,089

    hi peet

    Yes i did try that, but still gave me error : something - cannot find provider.....

  15. #15
    Fanatic Member dongaman's Avatar
    Join Date
    Aug 2001
    Location
    xi'an
    Posts
    616
    U may need:
    .....................
    cnn.Open "Provider=MSDataShape;Data Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\YourDatabase.mdb;Jet OLEDBatabase Password=YourPassword"
    .....................

    I am just aman.

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