I have an access password protected database.
I am using Visual Studio 2010 and ODBC.
What line of code must be added to successfuly connect to access protected file?
I am using this code:
Imports System.Data.Odbc
Imports System
Public Class DatabaseFunctions
Shared con As OdbcConnection
Public Shared Sub CreateConnection()
con = New OdbcConnection
con.ConnectionString = "Dsn=XXX"
con.Open()
End Sub
Private Shared Sub CheckConnection()
If con Is Nothing OrElse con.State = ConnectionState.Closed Then
CreateConnection()
End If
End Sub
End Class
Add this to your CreateConnection() function code:
Here are the way to go for several dbs