I have some code that updates an access database but it does not post all the records. The Response.Write bit brings back all 9 records but the update in the same loop only writes 8 records to the database. Anyone know why?
'gets records from a SQL database
s="select * from tbl_name where code = 1"
set rs2=db.execute(s)
while not rs2.eof
'this bit writes 9 records
response.write rs2("reference")
response.write "<br>"
'this bit writes 8 records to the Access database
set rs=server.createobject("ADODB.Recordset")
s="select * from MDB_Tablename where id=0"
rs.open s,db4,3,3
rs.addnew
rs.fields("reference") = rs2("reference")
rs.update
rs.close
rs2.movenext
wend
rs2.close
'gets records from a SQL database
s="select * from tbl_name where code = 1"
set rs2=db.execute(s)
while not rs2.eof
'this bit writes 9 records
response.write rs2("reference")
response.write "<br>"
'this bit writes 8 records to the Access database
set rs=server.createobject("ADODB.Recordset")
s="select * from MDB_Tablename where id=0"
rs.open s,db4,3,3
rs.addnew
rs.fields("reference") = rs2("reference")
rs.update
rs.close
rs2.movenext
wend
rs2.close