[dba-SQLServer] Delete

Wil Wakely wilw31 at gmail.com
Mon Aug 8 12:47:44 CDT 2011


Thanks for reply, MIchael.

>Why not just open the recordset sorted and loop 5 times deleting as you
go? I'm not sure but I seem to recall you don't need to movenext if you
are deleteing.

Like this?

'select rs and order by date
strsql1 = "SELECT * FROM rs WHERE player=1 ORDER BY playdate ASC
DoCmd.runsql strsql1
rs.movefirst

for n = 1 to 5
  rs.delete
next n

rs.update

Woops! I just read that a snapshot RS cannot be edited. I don't want to
modify the underlying table so I used snapshot rs. Is there another way to
play with the data in the table without modifying the underlying table?
-- 
===wil wakely
sunny san diego ca



More information about the dba-SQLServer mailing list