[thelist] CF: Determining which DB used.

Raymond Camden jedimaster at macromedia.com
Wed Sep 12 09:35:29 CDT 2001

> Raymond is right (of course), you should be able to write your app in 
> such a manner that it is portable, but if you must know which 
> database 
> you are using, then use cftry/cfcatch around two queries - one which 
> works in MS SQL only, and one which works in MySQL only, 
> whichever one 
> doesn't fail is the database in force, so set a variable 
> based on that.

I would strongly urge you NOT to do this. CFTRY/CFCATCH is a good idea
in general, but using it like this, where you KNOW an error is going to
happen is not a good idea. CFTRY/CFCATCH should be used when you
_believe_ an error _could_ occur. I f you _know_ an error will occur,
then you should not just let it stand.

Although, shoot, I believe Spectra does something like this, so I can't
always say that I practice what I preach.

Just my two cents. :)

Raymond Camden, Principal Spectra Compliance Engineer for Macromedia

Email    : jedimaster at macromedia.com
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 

More information about the thelist mailing list