1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
| Sub ajout_of()
If TextBox3.Text = "" Then
Exit Sub
End If
'insertion de data
Dim Connection As New OleDb.OleDbConnection()
Dim cmd As OleDbCommand
Dim DtSet As New DataSet()
Dim Sql As String
'ouverture de la connection
Connection.ConnectionString = "provider=microsoft.jet.oledb.4.0;" & "data source=" & TextBox2.Text & ";"
Dim dat As String
dat = Date.Now
Sql = "insert into ordre (ordre,poste,etat,date-entree,date-sortie) values ('" & TextBox3.Text & "','" & Environment.MachineName() & "','enposte',#" & dat & "#)"
cmd = New OleDbCommand(Sql, Connection)
Connection.Open()
cmd.ExecuteReader()
cmd.Connection.Close()
Label6.Text = TextBox3.Text
Label6.Refresh()
RadioButton1.Checked = True
TextBox3.Text = ""
TextBox3.Enabled = False
TextBox3.Focus()
System.Threading.Thread.Sleep(1000)
TextBox3.Enabled = True
RadioButton1.Checked = False
TextBox3.Focus()
End Sub |