2
Contributors
1
Reply
2
Views
10 Years
Discussion Span
Last Post by paulie
0

Easy. Import System.Data.OLEDB, then connect with this code:


Dim sAccessConn AsString = "
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Northwind.mdb;Jet OLEDBDatabase Password=YourPasswordIfNeeded"

Dim oAccessConn As OleDbConnection = New OleDbConnection(sAccessConn)

Dim cmdAccess As New OleDbCommand("Select * from Whatever", oAccessConn)

Dim adoAccessReader As OleDbDataReader = cmdAccess.ExecuteReader

adoAccessReader.Read()

If adoAccessReader.HasRows Then
'Do Stuff
End If

adoAccessReader.Close()

If oAccessConn.State = ConnectionState.Open Then
oAccessConn.Close()
End If

how to connect vb.net with ms assess

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.