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.

 All Forums
 Development Tools
 Other Development Tools
 check duplicate name

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. Usernames
2. Phone numbers

How could this be achieved ?

My code basically is two fold.

1. A recordset that checks
if not recordset.bof and not recordset.eof then
'do something. And redirect to say the value exists
end if

2. Run a SP to do an insert and authentication


Thanks

rockmoose
SQL Natt Alfen

3279 Posts

Posted - 2005-05-26 : 16:19:03
Are You returning a recordset with all the usernames & phonenumbers
to 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
Go to Top of Page

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 ?

thanks
Afrika
Go to Top of Page

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.asp

You could also use the return value of the sp.
0 = succesful
50001 = username duplicate
50002 = phonenumber duplicate
50003 = ...

Both methods would be ok imo.

rockmoose
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2005-05-27 : 16:58:34
thanks rockmoose
Go to Top of Page
   

- Advertisement -