'Interop.ADODB.Dll
Imports ADODB
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim con As ADODB.Connection
con = New ADODB.Connection
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=vbdotnetwithaccess.mdb"
con.Open()
Dim RS As New ADODB.Recordset
RS.Open("select * from Table1", con)
While Not RS.EOF
If TextBox1.Text = RS(0).Value Then
TextBox2.Text = RS(0).Value
End If
RS.MoveNext()
End While
con.Close()
con = Nothing
End Sub
End Class