Evidently if it wants to go to the next record after it deletes to last one. Without know what kind of database you have...

cxn.execute "delete from table-name" will clear all the records without trying to read the next one.