Retrieving SQL error messages

Results 1 to 2 of 2

Thread: Retrieving SQL error messages

  1. #1
    Join Date
    Dec 1969

    Default Retrieving SQL error messages

    In my ASP I have the folling code snippet:<BR><BR>On Error Resume Next<BR><BR> sSQL,cn<BR>myVar = rs(0)<BR>rs.close<BR><BR>If Err.number &#060;&#062; 0 then<BR> sError = Err.description<BR> nError = Err.number<BR>End If<BR><BR>Response.Write sError<BR><BR>My problem is that if the recordset fails due to an error in the SQL I want to get back the custom error message I raised in SQL, not the error saying that the recordset is closed which is what the above code gives me. Any ideas?<BR><BR>Thanks in advance for the help!

  2. #2
    Join Date
    Dec 1969

    Default RE: Retrieving SQL error messages

    You can put the check if err... right after the rs.Open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts