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


______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
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