dim prix as String
prix = txtPrix.text
Dim connection As OleDbConnection
Dim cmdConnection As New OleDbCommand
Dim strSQL As String
Dim intRowsAff As Integer
connection = New OleDbConnection( _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & masource & ";"
connection.Open
strSQL = "INSERT INTO Courses (CourseID, CourseName, Price, Tutor) VALUES ('" & Replace(txtNumero.Value, "'", "''") & "', '" & Replace(txtNomCours.Value, "'", "''") & "', " & prix & ", '" & Replace(txtNom.Value, "'", "''") & "') "
cmdConnection = New OleDbCommand(strSQL, connection)
Try
intRowsAff = cmdConnection.ExecuteNonQuery()
if intRowsAff = 1 then //Réussi intRowsAff = 1 =p :) :o)
connection.close
end if
Catch ex As Exception
connection.close
litErreur.text = ex.message //Je veux voir le message d'erreur sinon
End Try
bonne prog
@+