Skip to main content
Inspiring
July 14, 2006
Question

CFQuery Excel Spreadsheet

  • July 14, 2006
  • 1 reply
  • 602 views
I have an excel spreadsheet I have set up
an ODBC connection to for CF7.

I want to do a generic query of the data for
display....

in SQL I can do...
<cfquery..... >
select * from table
</cfquery>

How do I connect and read the data in Excel? cfquery?

Any help would be terrific....

DixieGal


    This topic has been closed for replies.

    1 reply

    July 14, 2006
    First, i am required by law to say that you would be better off porting the excel sheet to Access or MS SQL.

    Anyway...
    (1) Set up the ODBC source from the windows control panel.
    (2) Set up the datasource in the Coldfusion administrator and make sure it verifies OK.
    (3) Then you can query the workbook like so:

    <CFQUERY name="qFoo" datasource="EXCEL_DATA_SOURCE_FROM_CF_ADMIN">
    SELECT
    *
    FROM
    [Sheet1$]
    </CFQUERY>