Solved

Trap ODBC error code

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
OpenLDAP set password to expire 7 704
Redirect website ! 4 54
Problem to go to Web page 2 126
How can i point a subdomain to directory? 5 30
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…
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 …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

830 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