Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
Open a password protected Access DB
Author:
NBS Solutions
E-mail:
Click to e-mail author
Website:
http://www.netnet.ca
Submitted:
5/27/2004
Version:
VB6
Compatibility:
VB6
Category:
Databases
Views:
15316
How to open a password protected access database using ADO.
Declarations:
Dim cn As New ADODB.Connection, strCNString As String
Code:
Private Sub optionB() 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") = "NBSSolutions" 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=NBSSolutions" MsgBox "Data File is now opened" cn.Close End Sub
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement