Connecting Microsoft Access Database file to VB.NET application
I am writing the connection string property to connect a Visual Basic front end with an MS Access database:
note: this is the manual way, you can also add the database from the U.I in Visual Studio
Dim myConn As New OleDb.OleDbConnection
Dim strFile As String = "test.mdb"
Dim ConnString As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Jet OLEDB:Database Password=12345;" & _
"Data Source=" & strFile & ";"
test.mdb is the name of the MS Access database file
Password in the above string is the one you set up in Access itself and can be left blank if you hav'nt set one up
In the above code strfile string is the location of the database and can be modified to point to a shared drive so
that local GUI can network with database stored on network and multiple GUIs can access it; replicating the effect
of a web page.
Opening the database to interact with VB.NET
IO.Path.GetFileName(strFile) = "test.mdb"
' Open the DB
myConn.ConnectionString = ConnString
myConn.Open()
Hope this helps!!