Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 5th, 2006, 04:29 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 149
Thanks: 0
Thanked 0 Times in 0 Posts
Default record exist or not

Hi,
I have a form with an email field.
The user input his emails with comma separated like this [email protected],[email protected]
in the second page I split the string and now I want to check each email address in the db.if exist send err message if not go on.
the code below does not work.what should I do?
strTo=request.form("to")
strEmails=split(strTo,",")

For each strTo in strEmails
do while not rsExist.eof

if (strComp(RsExist("Email"),strTo, vbTextCompare)=0) then
response.write "email exist"

rsExist.movenext
loop

response.end
end if

next





 
Old May 5th, 2006, 09:07 AM
Registered User
 
Join Date: May 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to moooon
Default

Hi keyvanjan

Please try like this
Code:
strTo=request.form("to")
strEmails=split(strTo,",")

For each strTo in strEmails
    While not rsExist.EOF
        If UCase(Trim("" & RsExist("Email"))) = UCase(Trim(strTo)) Then
            Response.Write "email exist"
            Response.End        
        Else        
        End If        
        rsExist.MoveNext
    Wend
Next
Correct me if it is wrong
Regards,

 
Old May 5th, 2006, 11:39 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 149
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks a lot it worked






Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot create record, directory exist auxiora_nemesis PHP Databases 1 April 13th, 2008 11:04 PM
Insert where record doesn't already exist Neal SQL Server 2000 3 February 4th, 2008 10:09 AM
Return a record that doesn't exist in a table? Unregistered SQL Server 2000 4 May 3rd, 2006 01:27 AM
Lock Fields if record already exist jimmy0305 Access VBA 2 February 2nd, 2006 03:07 PM
Record source ... does not exist tunsted Access 2 April 1st, 2004 10:03 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.