how to connect vb.net with ms assess

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