Sorry, I should have included this the first time. I am using an Access database. "Overwrite" is a text field and I checked the case of "Yes" and it is correct. I'm stumped on this one. Any other ideas?
Thanks, PW > -----Original Message----- > From: professorw999 [mailto:[EMAIL PROTECTED] > Sent: 13 September 2004 23:40 > To: [EMAIL PROTECTED] > Subject: [ASP] Problem Updating Database Record > > > 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 > > > > > ------------------------------------------------------------------- -- > Home : http://groups.yahoo.com/group/active-server-pages > ------------------------------------------------------------------- -- > Post : [EMAIL PROTECTED] > Subscribe : [EMAIL PROTECTED] > Unsubscribe: [EMAIL PROTECTED] > ------------------------------------------------------------------- -- > Yahoo! Groups Links ------------------------ Yahoo! Groups Sponsor --------------------~--> Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar. Now with Pop-Up Blocker. Get it for free! http://us.click.yahoo.com/L5YrjA/eSIIAA/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/
