VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Open a password protected Access data file using ADO code

by NBS Solutions (5 Submissions)
Category: Databases/Data Access/DAO/ADO
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 27th May 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Open a password protected Access data file using ADO code

API Declarations


Dim cn As New ADODB.Connection, strCNString As String

Rate Open a password protected Access data file using ADO code





strCNString = "Data Source=" & App.Path & "\BB.mdb"
cn.Provider = "Microsoft Jet 4.0 OLE DB Provider"
cn.ConnectionString = strCNString
cn.Properties("Jet OLEDB:Database Password") = "aaa"
cn.Open

MsgBox "Data File is now opened"

cn.Close


End Sub


Private Sub OptionA()

cn.Open "Provider=Microsoft Jet 4.0 OLE DB Provider;Data Source=" & App.Path & "\BB.mdb" & ";Jet " _
    & "OLEDB:Database Password=aaa"
MsgBox "Data File is now opened"
cn.Close

End Sub

Download this snippet    Add to My Saved Code

Open a password protected Access data file using ADO code Comments

No comments have been posted about Open a password protected Access data file using ADO code. Why not be the first to post a comment about Open a password protected Access data file using ADO code.

Post your comment

Subject:
Message:
0/1000 characters