VB.NET Acces a une base de donnees Access MDB

Les imports

Imports System
Imports System.Data
Imports System.Data.OleDb

Le code:

Dim mCnx As OleDb.OleDbConnection = Nothing
mCnx = New OleDbConnection
mCnx.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data source=c:/mydb.mdb"
mCnx.Open()
Dim maCommand As New OleDbCommand("SELECT * FROM table1", mCnx)
Dim monReader As OleDbDataReader = maCommand.ExecuteReader()
While monReader.Read
debug.print monReader("ROW")
End While
monReader.Close()
mCnx.Close()