The only correct solution, i.e. FREE, Robust etc. is using DTS since you are using MS SQL.
DTS is written to do exactly that, it could import a big excel file in less than a second, where as coldfusion (which is not made to do these things) would take several minutes.
Its fairly simple to write a dts package, go into MS SQL -> right click Data Transformation Services -> New Package -> throw a Excel connection on there and follow the prompts -> throw a Microsoft OLE DB provider connection on there and follow the prompts -> then put a Transform Data Task on there (going from excel to SQL) double click this task and see if you can figure out what to do ;-) if you need any help let me know.
Main Topics
Browse All Topics





by: shooksmPosted on 2004-05-24 at 12:35:03ID: 11146020
Here are some suggestions:
You could install the Office Web Components on your web server. Then use the Excel object to open up an uploaded excel document and read data from it. (www.cfcomet.com has more info on OWC and the Excel object)
You could setup an Excel DSN in the CF Administrator pointing to a specific file location. A user would then upload their excel document and you would store it at that file location. Then you could write cfqueries off that datasource. The one thing you will have to do is ensure that two people aren't uploaded the file at the same time so you will have to implement some type of locking in your app.
You could upload the document to the web server then kick off a DTS job in SQL 2000 to read in the excel data. You could even have the page FTP the file directly to the SQL server to make writing the DTS job easier. Personally, I think this would be the best solution.
If you can get them to go for Tab or Comma delimited file types, you could do the import really easy from CF itself. Or make use of Bulk Copy/Bulk Insert in SQL server.
Just some ideas. Let me know if you want to expand on a particular one and I'll see how I can help.