Duplicated records message

Results 1 to 3 of 3

Thread: Duplicated records message

  1. #1
    Join Date
    Dec 1969

    Default Duplicated records message

    How can I make an ASP page to display a message telling the user that his Username (or any field he entered in a registration form) already exists in the DB and to prompt him to try with another one. Help is really apreciated. Thanx

  2. #2
    Join Date
    Dec 1969

    Default well..

    once u query the database to check the username, then write an If...Else<BR>if not rsobj.eof then<BR>response.write "user name already exists."<BR>else<BR>rsobj.addnew<BR>.<BR>.<BR>.<BR >rsobj.update<BR>end if

  3. #3
    Join Date
    Dec 1969

    Default RE: well..

    Yeah sort of like....<BR><BR>SQL = "Select count(*) from users where username=&#039;" & request("username") & "&#039;"<BR>set objrec = objconn.execute(SQL)<BR><BR>if objrec(objrec.fields(0).name) &#062; 0 then<BR> response.write("User alreday exists")<BR><BR>else<BR> &#039;Enter code here to add user to the database<BR>end if<BR>objconn.close<BR>set objrec = nothing<BR><BR><BR><BR><BR><BR>Just my .02<BR>-- Whol

Posting Permissions

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