I hope a reply to an old posting won't confuse things but I need help with the exact same question. In following the example above, I ended up with the code below. It does not crash but neither does it insert anything into the backup table. Can anyone see what I might be doing wrong?
[tt]Set rscomp = Server.CreateObject("ADODB.Recordset"

cmdTemp.CommandText = "select * Comp WHERE ID = " & ID
Set cmdTemp.ActiveConnection = DataConn
rscomp.Open cmdTemp, , 1, 3
Set rsbackup = Server.CreateObject("ADODB.Recordset"

cmdTemp.CommandText = "select * FROM CompDeleted"
Set cmdTemp.ActiveConnection = DataConn
rsbackup.Open cmdTemp, , 1, 3
dim item
rsbackup.AddNew
for each item in rscomp.Fields
If item.name="value" then
rsbackup(item.name)="changed value"
else
rsbackup(item.name) = rscomp(item.name)
end if
next
rsbackup.Update[/tt]
The only difference between the two SQL Server tables is that the backup table does not have autonumbering on the ID field. Don
don@pc-homepage.com
Experienced in HTML, Perl, VBScript, PWS, IIS and Apache. Run OS/2 Warp 4, BeOS v5 and Windows NT/2000 (only when I have to!)