I realize this is a little quirky, but here goes. I have a basic
script that searches my database table for the users email address.
IF the record does not exist THEN insert a new record. ELSE display
the "email already exists" message. However, I need to throw in one
kink. If the record already exists, but the Overwrite field
= "Yes", the record should be updated.
Below is the base of my script. If the record is found, it keeps
displaying the "email already exists" message. I can't seem to get
the excemption to work based on the Overwrite field. Does someone
see what I am missing?
mySQL = "SELECT * FROM tblProfiles WHERE fEmail = '" & strEmail & "'"
objRS...
objConn...
IF objRS.EOF THEN
objRS.AddNew
...
objRS.Update
ELSEIF objRS("Overwrite") = "Yes" THEN
objRS.MoveFirst
...
objRS.Update
ELSE
Response.Write "Your email already exists in our database."
END IF
Thanks,
PW
------------------------ Yahoo! Groups Sponsor --------------------~-->
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/17folB/TM
--------------------------------------------------------------------~->
---------------------------------------------------------------------
Home : http://groups.yahoo.com/group/active-server-pages
---------------------------------------------------------------------
Post : [EMAIL PROTECTED]
Subscribe : [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
---------------------------------------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/active-server-pages/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/