Results 1 to 2 of 2

Thread: Err.Description

  1. #1
    Join Date
    Dec 1969

    Default Err.Description

    [no one responded 1st post in almost a week]<BR><BR>One of the things I noticed about my generic onError trap is that when I call the error description property (Err.Description), I don’t get the same accurate description as I would normally get normally trough ASP. <BR><BR>For example: <BR>Suppose my database has been changed to a different folder path and I didn’t update my script code. If I would let plain ASP parse the error through my browser I would get: <BR><BR>Microsoft OLE DB Provider for ODBC Drivers error &#039; 80004005&#039; <BR>[Microsoft][ODBC dBase Driver] &#039;(unknown)&#039; is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides. <BR><BR>/filepath/folder/file.asp, line 58 <BR><BR>This narrows it down to the point and tells me exactly what’s wrong. <BR>Whereas if I where to use my own error handling trap, the description would not be at all the same. Instead I would get a more general one that wouldn’t be of much help: <BR><BR>&#060;% On Error Resume Next <BR>Response.Write(Err.Number &” <BR>”& Err.Description) %&#062; Would produce: <BR><BR>3704 <BR>The operation requested by the application is not allowed if the object is closed. <BR><BR>The above (error 3074 and description) would also be true for any ADODB error. Not very specific or descriptive eh? Is there any way to call the 1st description? <BR><BR>Thanking anyone in advance; <BR>Aaron

  2. #2
    Join Date
    Dec 1969

    Default Learn about ADODB.Error object...

    &#060;%<BR>conn.Errors.Clear<BR>On Error Resume Next<BR>Set RS = conn.Execute("SELECT * FROM nonExistentTable")<BR>On Error GoTo 0<BR>For Each oops In conn.Errors<BR>&nbsp; &nbsp; Response.Write "ADODB Error: " & oops.number & ", " & oops.description & "&lt;BR&#062;"<BR>Next<BR>%&#062;<BR><BR>Hokay?<BR ><BR>

Posting Permissions

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