Solved

Trap ODBC error code

Posted on 2000-02-22
3
228 Views
Last Modified: 2013-12-24
I would like to check for the existance of a SQL table via COLD FUSION.  I run a DROP TABLE tblxyz; and then would like to check for an ODBC error code S0002 in the case if the table does not yet exist.  If this is the case I want to branch around and get past the error.
0
Comment
Question by:tschiro
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
bigbadb earned 100 total points
ID: 2546536
<CFTRY>
      <cfquery datasource="ohiotest" name="testme">
            select *
            from tblxyz
      </cfquery>
<CFCATCH type="Database">
      <cflocation url="newpage.cfm">
</CFCATCH>
</cftry>



Something like this would work where newpage is the direct to

Hope this works
0
 

Expert Comment

by:anusha
ID: 2546604
bigbadb,

Is there a way to do the CFCATCH if I am using CF3.1 which does not support this tag?

Anusha
0
 
LVL 1

Expert Comment

by:bigbadb
ID: 2546891
you can try cferror but it doesnt work nearly as well as cfcatch and cfcatch is only available in CF 4.0
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

27 Experts available now in Live!

Get 1:1 Help Now