You might try an intentionally bad SQL statement, and wrap it with a
cftry/cfcatch to keep it quiet.

<cftry>
<cfquery...>
select Mr_T
from YoMomma
where PityDaFool = WhatchooTalkinBoutWillis
</cfquery>
<cfcatch>
<!--- do nothin' --->
</cfcatch>
</cftry>

I think bad SQL statements terminate the connection.

Worth a shot...

Jamie

On Thu, 18 Apr 2002 21:17:16 +0100, in cf-talk you wrote:

>I've already tried this and although it does remove the datasource
>connection, it doesnt resolve my problem of being returned a cached result
>in my select query.
>
>-----Original Message-----
>From: Ray Bujarski [mailto:[EMAIL PROTECTED]]
>Sent: 18 April 2002 20:53
>To: CF-Talk
>Subject: Re: How to close Excel ODBC connection at end of query
>
>
><CFSET CFUSION_DISABLE_DBCONNECTIONS("excel", 1)>
>Ray
>
>At 08:45 PM 4/18/2002 +0100, you wrote:
>>Hi,
>>
>>Further to my problem of aparently retrieving cached query results when
>>using an excel datasource (see earlier email titled Strange behaviour with
>>excel datasource), I've discovered that CF seems to be keeping the ODBC
>>connection alive across requests.
>>
>>Does anybody know how to force a shutdown of excel?
>>
>>I've tried a few different methods to date. Namely:
>>
>><CFSET CFUSION_DISABLE_DBCONNECTIONS("exceldsn", 1)>
>><CFSET CFUSION_DISABLE_DBCONNECTIONS("exceldsn", 0)>
>>to disable and enable write access to the datasource
>>
>>OR using CFOBJECT
>>
>>                 <!--- Try to connect to the Excel application object --->
>><CFTRY>
>>     <!--- If it exists, connect to it --->
>>     <CFOBJECT
>>         ACTION="CONNECT"
>>         CLASS="Excel.Application"
>>         NAME="objExcel"
>>         TYPE="COM">
>>   <CFCATCH>
>>     <!--- The object doesn't exist, so create it --->
>>     <CFOBJECT
>>         ACTION="CREATE"
>>         CLASS="Excel.Application"
>>         NAME="objExcel"
>>         TYPE="COM">
>>   </CFCATCH>
>></CFTRY>
>>
>><CFSCRIPT>
>>      // Quit Excel
>>     objExcel.Quit();
>>
>>     // Release the object
>>     objExcel = "Nothing";
>></CFSCRIPT>
>>
>>to try to shut down the connection.
>>
>>
>>This is really frustrating because all I am trying to do is a simple update
>>query (to insert variables to a formula), followed by a select statement to
>>retrieve the result of a formula contained in the excel file. This is
>>analogous to doing an insert, followed by a select to retrieve a new ID
>>numnber using any other RDBMS ODBC drivers.
>>
>>I've even created and triggered (using cfexecute)a DTS package to import
>the
>>data into SQL 7 after having carried out the update query, but this gives
>me
>>an error message indicating that the excel file is already in use, despite
>>my various attempts at forcing closure of the file.
>>
>>Any help would be much appreciated,
>>Dave
>>
>>
>>
>
>
______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to