I'm trying to create an application and capture my bugs using the old "on error resume next" statement. However, when it hits a bug it just stops dead.. Any ideas, before I rip my hair out?
Below is a test script that produces the result specified above. The script should send an email to me to tell me of the error, but instead it just quits the getFromDatabase sub and continues the main part of the code!
Below is a test script that produces the result specified above. The script should send an email to me to tell me of the error, but instead it just quits the getFromDatabase sub and continues the main part of the code!
Code:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
sub openDb()
if varType(connTemp)=0 or varType(connTemp)=1 then
' create the connection
set connTemp = server.createObject("adodb.connection")
connTemp.Open MM_RockManager_STRING
end if
end sub
sub getFromDatabase(mySQL, rsTemp, scriptName)
'response.write scriptName & " - " & mySQL & "****"
call openDb()
set rsTemp = server.createObject("adodb.recordset")
' set locktype
rsTemp.lockType = adLockReadOnly
' set the cursor
rsTemp.cursorType = adOpenForwardOnly
'response.write mySQL
rsTemp.open mySQL, connTemp
'Do error checking
If err.number <> 0 then
tmpMessage = "ERROR FOUND<br /><br />" &_
"getFromDatabase: " & scriptName & " ... Band ID: " & tmpBandID & "<br /><br />"&_
" Source: " & err.source &_
" Number: " & err.number &_
"Description: " & err.description & "<br /><br />"&_
"Now: " & now()
sendEmail "[name]", "[email]", "Bug Report!", tmpMessage
err.clear
end if
end sub
%>
<%
on error resume next
mySql="SELECT * FROM tbl_Bandsfgh WHERE bandName = 32;"
call getFromDatabase (mySql, rsTemp, "LoginMember")
response.write("test text")
%>
