Correct me if I'm wrong - error trapping

Results 1 to 2 of 2

Thread: Correct me if I'm wrong - error trapping

  1. #1
    Rob Guest

    Default Correct me if I'm wrong - error trapping

    I want a second opinion on this theory.<BR><BR>I am registering users in a database. If I try to enter a user who is already there, I get an error that I am trying to overwrite the primary key. Normally, I parse the database <BR>looking for dulicates but wouldn&#039t it be iser just to trap this error? <BR><BR>if(err.number) = 0 Then<BR>response.write("You have already registered")<BR>Else<BR>set rs = adoDB.execute(SQL)<BR>End If<BR><BR>Thanks,<BR><BR>Rob

  2. #2
    Join Date
    Dec 1969
    Posts
    2,849

    Default RE: Correct me if I'm wrong - error trapping

    That&#039s one way you could do it, but what if a different error came back? You would want to test for the correct error.<BR><BR>In my opinion, it is better to just scan the database the first time through.

Posting Permissions

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