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
| 'necessite d'activer la reference
'Microsoft ActiveX Data Objects 2.0 Library
Dim Conn As New ADODB.Connection
Dim rsT As New ADODB.Recordset
With Conn
.Provider = "Microsoft.JET.OLEDB.4.0"
.Open ThisWorkbook.Path & "\MaBase_V01.mdb"
End With
With rsT
.ActiveConnection = Conn
.Open "Table1", LockType:=adLockOptimistic
End With
With rsT
.AddNew
.Fields("Nom").Value = "leNom"
.Fields("PrixUnit").Value = 195
.Fields("Matricule").Value = 47767
.Update
End With
rsT.Close
Set rsT = Nothing
Conn.Close
Set Conn = Nothing
MsgBox "Export terminé" |
Partager