1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MonDossierProjet\MaBase_De_Donnee.mdb"
Dim connectstr As New OleDb.OleDbConnection(connectionString)
connectstr.Open()
Dim command As New OleDb.OleDbCommand
command.CommandText = "SELECT * FROM TA_TABLE where Champ_Numero= '" & TextBox1.Text & "' "
Dim LeReader As OleDb.OleDbDataReader = command.ExecuteReader()
If LeReader.Read() Then
TextBox2.Text = LeReader!Nom
TextBox3.Text = LeReader!Prenom
TextBox4.Text = LeReader!DateNaissance
End If
LeReader.Close()
LeReader = Nothing
connectstr.Close()
connectstr.Dispose()
connectstr = Nothing |