Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
afrika
Master Smack Fu Yak Hacker
2706 Posts |
Posted - 2005-05-26 : 15:52:45
|
hi,I have a signup form.I would like to be able to check for duplicate entries during the signup.E.g. Check for duplicate 1. Usernames2. Phone numbersHow could this be achieved ?My code basically is two fold.1. A recordset that checksif not recordset.bof and not recordset.eof then'do something. And redirect to say the value existsend if2. Run a SP to do an insert and authenticationThanks |
|
rockmoose
SQL Natt Alfen
3279 Posts |
Posted - 2005-05-26 : 16:19:03
|
Are You returning a recordset with all the usernames & phonenumbersto the signup form for duplicate validation ?To me that does not seem like a very good idea.I would pass the username + phonenumber to a sp,and have the sp handle the logic and return an errorcode if there are duplicates.rockmoose |
|
|
afrika
Master Smack Fu Yak Hacker
2706 Posts |
Posted - 2005-05-26 : 16:32:17
|
thanks rockmoose.I wanted to use strictly an SP, but i do know about output parameters, but dont know how to get my ASP page to read my output parameters.What do you advice ?thanksAfrika |
|
|
rockmoose
SQL Natt Alfen
3279 Posts |
Posted - 2005-05-26 : 17:11:29
|
You would have to specify the paramter as adParamOutput.This article explains the use of paramters in ASP:http://www.asp101.com/articles/wrox/asp30/26100903.aspYou could also use the return value of the sp.0 = succesful50001 = username duplicate50002 = phonenumber duplicate50003 = ...Both methods would be ok imo.rockmoose |
|
|
afrika
Master Smack Fu Yak Hacker
2706 Posts |
Posted - 2005-05-27 : 16:58:34
|
thanks rockmoose |
|
|
|
|
|