This is a common question.
The easiest answer is to treat the excel file as a datasourcein cold fusion.
Here is how to do that :
In CF 5 there should be an option of 'Excel' when you define a data source. In CFMX since it uses JDBC you must first create a system ODBC connection, then in CFMX set it up as an ODBC bridge connection. One that is in place you can query the excel file like this:
<cfquery name="queryname" datasource="excelDSN">
select * from `sheet1$`
</cfquery>
A quirky thing is that the quotes around the sheet name MUST BE LIKE THIS: ` and NOT LIKE THIS: '
OR from jyokum
setup a MS Access datasource (doesn't matter if it has any tables)
<cfquery name="qryXLSdata" datasource="myAccessPassth
SELECT *
FROM [Sheet1$]
IN 'c:\path\to\file.xls' 'EXCEL 5.0;'
</cfquery>
this is a pretty good work around for the lack of dynamic connect strings in CFMX. it works for other file types as well... CSV, DBF, XLS, MDB
Main Topics
Browse All Topics





by: poorgodPosted on 2004-05-06 at 13:27:54ID: 11009537
Of you are a little familiar calling java objects from coldfusion, you can use a Java API for excel, there is one at xcelapi/ ramming/ex cel2query. cfm
http://www.andykhan.com/je
and the easier way, there is a CFX tag for it at
http://www.emerle.net/prog
Hope this helps