it will, actually. if you catch database errors, use some CFIFs against the
native error code value (cleverly named NativeErrorCode) in CFCATCH.
<CFTRY>
...Database insert stuff...
</CFTRY>
<CFCATCH TYPE="Database">
<CFIF NativeErrorCode EQ "whatevr the error code is for that unique key
constraint">
...pretty error message here...
<CFELSE>
..other DB error message...
</CFIF>
</CFCATCH>
chris olive, cio
cresco technologies
[EMAIL PROTECTED]
http://www.crescotech.com
-----Original Message-----
From: Dave Hannum [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 28, 2000 2:29 PM
To: CF-Talk
Subject: Custom Error Message
I have an Oracle database that had columns that set to allow only one of
each ID number. What's the best way to produce a custom error message that
tells the user that the ID they're attempting to enter is alreay in the
database, instead of the ugly CF/Oracle unique constraint error message.
CFTRY/CFCATCH alone won't signal the unique constraint problem.
Thanks,
Dave
=================================
"What we need is a list of specific unknown problems we will encounter"
David Hannum
Web Analyst/Programmer
Ohio University
[EMAIL PROTECTED]
(740) 597-2524
----------------------------------------------------------------------------
--
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.