Solved

Trap ODBC error code

Posted on 2000-02-22
3
216 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
Comment Utility
<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
Comment Utility
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
Comment Utility
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
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 …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

771 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

10 Experts available now in Live!

Get 1:1 Help Now