Results 1 to 4 of 4

Thread: Password protected MDB

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2000
    Location
    Rafaela (Argentine)
    Posts
    107

    Question

    I have a password protected MDB. Which properties I have to set up, and how, in an ADO Connection to access it?

    Thanks in advance.

  2. #2
    Lively Member
    Join Date
    Oct 2000
    Location
    Chicago
    Posts
    97

    Sorry......

    Hi,
    Iam just going thru some books on that topic for my necessity and i read books saying that

    "Unfortunately there is no way to set,change,or clear a database password by using ADO code.But you can do the same with DAO"

    Anil

  3. #3
    Guest
    maybe this will help a bit, note the nice little problem with in the .Properties string:

    Code:
    Private Sub Form_Load()
    
        Dim rs As ADODB.Recordset
        
        Set rs = New ADODB.Recordset
    
        rs.Open "Test", GetConn(App.Path & "\test.mdb", "test"), adOpenStatic, adLockOptimistic
    
        Set Grid.DataSource = rs
        Set rs = Nothing
    
    End Sub
    
    Private Function GetConn(ByRef Path As String, _
                             ByRef Pwd As String) As ADODB.Connection
    
        Dim cn As ADODB.Connection
    
        Set cn = New ADODB.Connection
     
        With cn
            .Provider = "Microsoft.Jet.OLEDB.3.51"
            .Properties("Jet OLEDB:Database Password") = Pwd
            .Open Path
        End With
    
        Set GetConn = cn
    
        Set cn = Nothing
    
    End Function
    [Edited by Sascha on 11-10-2000 at 05:33 PM]

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Check the "Disable smilies in this post" box when posting a message.

    JMuller - I hate to say it, but Access DBs have probably the worst security in the world .
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

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