Public Sub Insert_Record_MDB(ByVal nameTable As String, ByVal champTable As String, ByVal valueTable As String, Optional baseSelect As Integer = 0) Using objetConnection As New OleDbConnection objetConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source= " & path.Combine(Application.StartupPath , "base.mdb") & ";" objetConnection.Open() Using objetCommand As New OleDbCommand objetCommand.Connection = objetConnection objetCommand.CommandType = CommandType.Text objetCommand.CommandText = "INSERT INTO " & nameTable & " (" & champTable & ") VALUES (" & valueTable & ")" objetCommand.ExecuteNonQuery() End Using objetConnection.Close() End Using Application.DoEvents() End Sub
EDIT : Ajout des balises de code (la coloration syntaxique).
Explications disponibles ici :ICIMerci d'y penser dans tes prochains messages.Jordane45 |