Results 1 to 2 of 2
Thread: Error Handling
Apr 15, 2011, 03:34 #1
I have the following code:
On Error Resume Next SET COM=SERVER.CREATEOBJECT("ADODB.COMMAND") COM.ACTIVECONNECTION=CONN COM.COMMANDTIMEOUT=600 'Execute the SQL com.commandtext = "SET NOCOUNT ON SET DATEFORMAT DMY "&SQL Set Rec = Com.Execute 'When the Error is not 0 If Err.number <> 0 Then Message = "<h4><strong>Warning:</strong> An error occured during this database transaction. <br /><br />" Message = Message & Err.Description & "</h4>" If rDebug = 1 Then Message = Message & "<br /><h5>Database query: " & SQL & "</h5>" End If Err.Clear Response.Write (Message) Response.End End If On Error Goto 0
But the problem is that i cannot get the line number out, i tried Err.Number but that gave me a negative number?
How can i achieve this?
Kind regards,Software Engineer ASP, ASP.NET, VB, PHP
Apr 15, 2011, 06:03 #2