JohannIcon
Programmer
I have a page where I display a list of Years and Months from a table and a corresponding list of checkboxes, so that the user can choose whichever date (can be more than one choice) to delete from the table. The problem is that I have something wrong with the looping which I cannot find. Here is the code of the looping, the problem is that
its looping on the same record instead of going through all the recordset and deleting the Id where I have clicked the checkbox!
Here is my code:-
if not rsClientStats.EOF or NOT rsClientStats.BOF then
rsCLientStats.movefirst
do
if NOT CheckVal = "" then
'*** Delete the record from the database
sqlDeleteStat = "DELETE FROM Stats "
sqlDeleteStat = sqlDeleteStat & "WHERE clientID =" & ChosenClient & " "
sqlDeleteStat = sqlDeleteStat & "AND statsID =" & CheckVal & ";"
response.Write(sqlDeleteStat)
response.Write("<p></p>"
' rsDeleteStat.Open (sqlDeleteStat)
end if
rsClientStats.movenext
loop until rsClientStats.EOF
end if
its looping on the same record instead of going through all the recordset and deleting the Id where I have clicked the checkbox!
Here is my code:-
if not rsClientStats.EOF or NOT rsClientStats.BOF then
rsCLientStats.movefirst
do
if NOT CheckVal = "" then
'*** Delete the record from the database
sqlDeleteStat = "DELETE FROM Stats "
sqlDeleteStat = sqlDeleteStat & "WHERE clientID =" & ChosenClient & " "
sqlDeleteStat = sqlDeleteStat & "AND statsID =" & CheckVal & ";"
response.Write(sqlDeleteStat)
response.Write("<p></p>"
' rsDeleteStat.Open (sqlDeleteStat)
end if
rsClientStats.movenext
loop until rsClientStats.EOF
end if