Dim con As OleDbConnection = New OleDbConnection("Provider=Microsoft.jet.oledb.4.0;data source=D:\myDB.mdb")
Dim cmd As New OleDbCommand
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "MyQueryName"
cmd.Parameters.Add("@Parameter1", OleDbType.VarChar).Value = "value1" ' Add Parameter
cmd.Connection = con
con.Open()
Dim da As OleDbDataAdapter = New OleDbDataAdapter(cmd)
Dim ds As DataSet = New DataSet()
da.Fill(ds, "Table1")
DataGridView1.DataSource = ds.Tables("Table1") ' Binding to DataGridView
con.Close()
เขียนคล้ายๆ Store Procedure ใน MS SQL นะครับ ประยุกต์ดู