1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
Dim MyConnection as ADODB.Connection
Dim rs as ADODB.RecordSet
Try
MyConnection = New ADODB.Connection
MyConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Application.StartupPath & "\gestionnairebdd.mdb;Persist Security Info=False"
MyConnection.Open()
Catch ex As Exception
MsgBox(ex.Message)
End Try
Try
S1 = "INSERT INTO Adherents(NumAdherent,Nom,Prenom) VALUES(1,'Toto','Tata');"
rs = MyConnection.Execute(S1)
rs.Fields.Refresh()
rs = Nothing
MyConnection.Close()
MyConnection = Nothing
MsgBox("Validation")
Catch ex As Exception
MsgBox(ex.Message)
End Try |