If you're trying to capture duplicates of a single field value, you could
use the database to catch the error. Set the field properties as Indexed
(no duplicates) in Access. Then wrap your <cfquery> in a <cftry> block to
capture the error:
<cftry>
<cfquery...>
Insert ...
</cfquery>
<cfcatch type="database">
...There was an error in the insert statement...
</cfcatch>
</cftry>
This will only stop exact matches (case-sensitive) and won't work if you
need to match multiple fields.
> -----Original Message-----
> From: Lisa Greenberg [mailto:[EMAIL PROTECTED]]
> Sent: Friday, July 21, 2000 10:50 AM
> To: cftalk
> Subject: Preventing duplicates prior to insert
>
>
> I would like to prevent duplicate entries from being
> inserted to a table (MS Access). Is there a way to do this
> without querying the database and comparing the
> "pre-inserted data" with data currently in the table?
>
> Any leads in the right direction is most appreciated.
>
> -- Lisa
>
> ------------------------------------------------------------------
> ------------
> Archives: http://www.mail-archive.com/[email protected]/
> To Unsubscribe visit
> http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf
> _talk or send a message to [EMAIL PROTECTED] with
> 'unsubscribe' in the body.
>
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.