D
Dom
I'm using ADO and trying to Add a new record to a table using the AddNew
Method. The entire recordset (about 2,400 records) is being successfully
added with the exception of the LAST record.
An example of some of the code I'm using is as follows -
cnAdd.open cnString
cnAdd.BeginTrans
rsCopy.open strSQL, etc etc
Do Until rsCopy.EOF
strSQL = "SELECT Item FROM tbl WHERE Name = '" & rsCopy!name & "'"
rsRule.Open strSQL, cnAdd, adOpenDynamic, adLockOptimistic
Do Until RSRule.EOF
rsRule.Addnew
rsRule!Item = "Item"
Loop
rsrule.close
Loop
cnAdd.CommitTrans
cnadd.close
(There is error trapping which will RollBack the transaction.)
I've tested the code and the last item is definitely there when I step
through the code but it gets lost once it leaves the loop.
So, is there something obvious I'm missing?
Method. The entire recordset (about 2,400 records) is being successfully
added with the exception of the LAST record.
An example of some of the code I'm using is as follows -
cnAdd.open cnString
cnAdd.BeginTrans
rsCopy.open strSQL, etc etc
Do Until rsCopy.EOF
strSQL = "SELECT Item FROM tbl WHERE Name = '" & rsCopy!name & "'"
rsRule.Open strSQL, cnAdd, adOpenDynamic, adLockOptimistic
Do Until RSRule.EOF
rsRule.Addnew
rsRule!Item = "Item"
Loop
rsrule.close
Loop
cnAdd.CommitTrans
cnadd.close
(There is error trapping which will RollBack the transaction.)
I've tested the code and the last item is definitely there when I step
through the code but it gets lost once it leaves the loop.
So, is there something obvious I'm missing?