Do NOT go the DSN route if you want to have any sanity left. Find yourself a third-party tool that parses Excel files into query data. There are several. If you're running CF6.1 or higher then I'd recommend CFX_Excel from MasRizal.com. No, I don't work for them, but have used it on several projects and am extremely satisfied with the results.
http://www.masrizal.com/in
Main Topics
Browse All Topics





by: shooksmPosted on 2006-09-25 at 11:24:28ID: 17594777
If there is going to be a single user uploading the document, it would be easier to setup a DSN pointing to a known location that you will store the excel file when the user uploads it. First, create a blank XLS file in the location you are going to allow the user to stick the file in. Maybe something like wwwroot\excelupload\temp.x ls. I would then create a system DSN for the excel file via the ODBC Data Source Administrator. In Cold Fusion Administrator add an ODBC Socket Datasource to your System DSN. Now you can query directly from the uploaded file using standard CFQUERYs. The first thing I would do is upload an actual version of the file then run the following SQL in a CFQUERY and dump the recordset to see the columns:
SELECT * FROM [Sheet1$]