...

View Full Version : insert new record with not duplicate record



rosehabib
03-23-2006, 03:06 PM
i want to insert new record which is will not duplicate with the previous record.
if the record duplicate, the error message will appear.how can i do it??

degsy
03-23-2006, 03:45 PM
Unless you have your database fields setup with a UNIQUE flag then you can do a select first and check against it.

e.g.

username = "john"

SELECT from table where field = username

if NOT rs.EOF then
error - name already exists
else
INSERT INTO field values (username)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum