Solved

Trap ODBC error code

Posted on 2000-02-22
3
231 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

770 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