This topic is locked

Delete All Records

12/16/2008 3:33:02 PM
ASPRunnerPro General questions
M
mgill author

I am trying to figure out how to have a button that will DELETE all Records from a table. The table has 4,000 plus records, but I am only able to figure out how to delete 500 at a time by selecting the view 500 records, checking the Select Box at the header line on the LIST PAGE and then hetting the DELETE Buttong. It works, and deletes 500 records, but how do I delete ALL RECORDS in the table. any help would be GREATLY APPRECIATED. Thank You.

J
Jane 12/17/2008

Hi,
here is sample code for button:

<input type=button class=button value="Delete All" onclick="window.location.href='tablename_list.asp?delete=all';">



Add this code on the Visual Editor tab in HTML mode.
Then check request.querystring("delete") in the List page: Before process event on the Events tab and delete records if needed:

if request.querystring("delete")="all" then

dbConnection.Execute "delete from TableName"

end if

M
mgill author 12/17/2008

THANK YOU SO MUCH !!!!!!

Worked perfectly !

Hi,

here is sample code for button:
Add this code on the Visual Editor tab in HTML mode.
Then check request.querystring("delete") in the List page: Before process event on the Events tab and delete records if needed: