Error codes for record sets

Results 1 to 2 of 2

Thread: Error codes for record sets

  1. #1
    Hemant Guest

    Default Error codes for record sets

    If I insert or delete a record using a query , how I can know that the query execution was successful and didn&#039t report any errors. Also if there was any error , how can I know about it. As I haven&#039t worked much in database handling, please let me know about it.

  2. #2
    Join Date
    Dec 1969

    Default RE: Error codes for record sets

    If you are using JScript then look into the try ... catch block.<BR><BR>However if (as I do) you use VBScript as your scripting language then:<BR><BR>&#060;quote from Designing Active Server Pages, p.46&#062;<BR><BR>you can determine whether an error has just occurred by checking the number property of the Err Object. If no error has occurred, this property will equal zero. If an error has occurred, the property&#039s value will be unequal to (ie: greater or less than) zero.<BR><BR>&#060;/quote&#062;<BR><BR>Here is an example of using error handling on an ASP page:<BR><BR><BR>&#039Enable error handling for this page.<BR>On Error Resume Next<BR><BR>... Do something like open a connection and insert records<BR><BR>&#039Now we can check to see if an error occurred.<BR>If Err.Number &#060;&#062; 0 Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Insert some error handling code here.<BR>End If<BR><BR>Thats it!!!<BR><BR>Here is a useful link to the Err documentation on the MSDN site:<BR><BR><BR>HTH<BR><BR>Darren<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