[thelist] Web Forms to Access DB?

Allie Micka allie at pajunas.com
Tue Jan 8 10:21:27 CST 2002


>> Using the database constraint method with Cold
>> Fusion, are you pretty safe doing a cftry/cfcatch like this?
>> <cftry>
>>    <cfquery>INSERT...</cfquery>
>>    <cfcatch type="database">
>>        Sorry, try another username...
>>        <cfinclude template="form_register.cfm">
>>    </cfcatch>
>> </cftry>

That ought to work but if you can figure out what type of exception its 
throwing you will be better off.  This code will say "Sorry, try another 
username" for any exception, even if the database is down entirely and it 
will frustrate the heck out of the user!

This code though, presents a good solution in a very short amount of time 
(which is usually better than perfection anyway).

Allie Micka
pajunas interactive, inc.
http://pajunas.com





More information about the thelist mailing list