<cftry>
    <cfquery datasource="#request.yourDsn#">
                insert into hmls_photos
           (photo_filename, photo_mls_number)
        values (<cfqueryparam cfsqltype="cf_sql_varchar" 
value="#photolist.name#">,
            <cfqueryparam cfsqltype="cf_sql_varchar" 
value="#listfirst(photolist.name, '_')#">)
        </cfquery>
  <cfcatch>
    <cfif cfcatch.message contains "Duplicate entry">
        <cfoutput><br />Duplicate entry: #photolist.name#</cfoutput>
    <cfelse>
       <cfrethrow><!--- Not a duplicate entry error, throw error --->
    </cfif>
  </cfcatch>
</cftry>

That should do the trick!

Wim. 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305449
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to