Ciao, se devi modificare tutti i record che hanno codice.text = rsDB.Fields(0) e lunghezza.text = rsDB.Fields(1), ti conviene usare le query.
Una cosa del genere:
codice:
dim numRecAggiornati as long
strSqlUpdate="UPDATE TuaTabella SET CampoQuantita = (CampoQuantita + " & quantità.text & ") WHERE CampoCodice = " & codice.text & " AND CampoLunghezza = " & lunghezza.text & ";"
TuaConnessione.Execute strSqlUpdate, numRecAggiornati, adExecuteNoRecords
if numRecAggiornati=0 then
strSqlInsert="INSERT INTO TuaTabella (CampoCodice, CampoLunghezza, CampoQuantita) VALUE (" & codice.text & "," & lunghezza.text & "," & quantita.text & ");"
TuaConnessione.Execute strSqlInsert,,adExecuteNoRecords
end if
Attenzione, io ho dato per scontato che codice, quantita e lunghezza siano tutti di tipo numerico, se sono di tipo carattere, nelle query i valori devono essere racchiusi tra apici..