Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old May 5th, 2006, 04:29 AM
Friend of Wrox
 
Join Date: May 2005
Location: , , .
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 a@a.com,b@b.com
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





Reply With Quote
  #2 (permalink)  
Old May 5th, 2006, 09:07 AM
Registered User
 
Join Date: May 2006
Location: , , Malaysia.
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,

Reply With Quote
  #3 (permalink)  
Old May 5th, 2006, 11:39 AM
Friend of Wrox
 
Join Date: May 2005
Location: , , .
Posts: 149
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks a lot it worked

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 09: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 02:07 PM
Record source ... does not exist tunsted Access 2 April 1st, 2004 09:03 AM



All times are GMT -4. The time now is 07:00 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.