Checking for Duplicate usernames.

Results 1 to 2 of 2

Thread: Checking for Duplicate usernames.

  1. #1
    David Highlander Guest

    Default Checking for Duplicate usernames.

    I want to check and make sure that a "USERNAME" has not already been taken. <BR><BR>If I am passing a form called "usernamedata" to another page - and that form gets inserted into a table field called "username" what type of staetement can I write to see if the username is already taken BEFORE it ever gets inserted?

  2. #2
    SPG Guest

    Default RE: Checking for Duplicate usernames.

    set checkRS = objConn.execute("select top 1 userName from myTable where userName = &#039" & userName & "&#039")<BR>if not checkRS.eof then<BR> &#039 The UserName is already in use<BR>else<BR> &#039 The UserName is not already in use<BR>end if<BR>checkRS.close<BR>set checkRS.eof<BR><BR>Alternately, you could put a "unique" or "primary key" constraint on the user name.<BR><BR>HiH

Posting Permissions

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