Originariamente inviato da vr-claudio
Qui sotto vi inserisco un pezzo di codice che utilizzo per inserire i dati delle text nel record di una tabella access:
Dim DB As ADODB.Connection
Dim T As ADODB.Recordset
Dim strCnn As String
Set DB = New ADODB.Connection
strCnn = "" _
& "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=C:\ESEMPIO\DB\PIPPO.mdb"
DB.Open strCnn
Set T = New ADODB.Recordset
T.LockType = adLockOptimistic
T.Open "ID", DB, , , adCmdTable
T.AddNew
T("NOME") = TXT_NOME.Text
T("COGNOME") = TXT_COGNOME.Text
T("DATA") = LBL_DATA.Caption
T.Update
T.Close
DB.Close