I have a requirement where contents of an Excel file will be uploaded to a database (which will be done frequently). I'm trying to use the ODBC connection to an Excel and it does not work. Does anyone have a working syntax? Thanks.
Try selecting the area of the worksheet you plan to use as your "table", then select INSERT, NAME, DEFINE and give the selected area a name. Type the name and click "Add". That becomes your tablename.
Then point your datasource to that spreadsheet using the Excel driver. Verify the datasource. Note that the spreadsheet should not be open or it won't verify. Say your datasource is "spreadsheet".
Now, suppose you named your selected area "chartdata". The first row should be labels, like "People", "Dogs", "Cats".
Subsequent rows are numbers, "10", "5", "3".
<cfquery datasource="spreadsheet" name="getChartData">
SELECT * FROM chartdata
</cfquery>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.