Click to See Complete Forum and Search --> : Preventing duplicate entries into Access based on 2 fields


adinanet
03-25-2004, 03:42 PM
Ok, here's the situation:

I know how to make an ASP form that will insert any inputted information into an Access Database and how to validate that no fields are empty, that the email field contains an "@", etc.

I have a client who wants to have users fill out a form to request a free sample of their product, but wants to prevent users from filling out the form 1,000 times and reselling it on eBay or something!

So, basically, I need a script that will check if the Street Address/Zip Code COMBINATION already exists in the database and if that combination exists, will not write a new, duplicate record and return an error message to the web page.

I've looked all over the web, and I've only been able to find how to check for duplicates in one field, not a combination of two fields. I know the basics of ASP, can create ASP forms, includes and the easy basic stuff, but I'm far from an expert and I hoped that someone could give me a hand!

Thanks in advance!

A :confused:

PeOfEo
03-25-2004, 04:43 PM
so, before you run the insert script run select statement to make sure those are not already in your data base and if they are not then insert it.

adinanet
03-26-2004, 08:12 AM
Thanks - I will do that (I knew it was something like that, but being only semi-ASP-literate, I wasn't sure)!