if rs.eof = true then response.write "eof is true" if rs.eof = false then response.write "eof is false"
發(fā)現(xiàn)輸出竟然是eof is true eof is false, 說明無法判斷rs.eof的值,為何如此百思不得其解。檢查數(shù)據(jù)庫,發(fā)現(xiàn)庫中并沒有mytable表, 如果該表不存在,rs.open "select * from mytable", conn 就會出錯,為何沒有出錯,很有可能捕獲的異常被忽略了。 檢查包含文件conn.asp, 發(fā)現(xiàn)了異常處理代碼:
on error resume next
原來問題在此。
on error resume next忽略了查詢表時的失敗以及后續(xù)的錯誤,造成進入死循環(huán)。 那為何網(wǎng)站本來運行正常,現(xiàn)在卻找不到mytable表了呢?仔細檢查網(wǎng)站才發(fā)現(xiàn)“有‘客'自遠方來”,上傳了后門工具、刪除了多張數(shù)據(jù)表,害我忙活了一天。