Skip to main content
October 26, 2010
Question

Excel Database

  • October 26, 2010
  • 2 replies
  • 809 views

Is it possible to use a Microsoft Excel file to store data using Coldfusion? How do you take data stored in an Apache Derby Embedded database and put it in a comma delimited format to be exported into an Excel or Access file?

This topic has been closed for replies.

2 replies

Inspiring
October 26, 2010

Are you trying to say you want to export data from your database and put it into an XLS file?  I think that's what you're trying to say.

The answer kinda relies on knowing what version of CF you are using.  CF9 has native XLS support built in, in the shape of various functions:

http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WS890819DC-DE4D-4b24-A237-6E3483E9D6A1.html

As well as <cfspreadsheet> and the like.

If you're on CF8 or earlier, perhaps have a look @ Apache POI:

http://poi.apache.org/spreadsheet/index.html

--

Adam

Legend
October 27, 2010

Reading the question again perhaps I understand it differently this time. Maybe  want to do this from Ben Forta blog:

<cfspreadsheet action="read" src="Sales.xls" query="myQuery"> <cfdump var="#myQuery#">

more detail here:

http://www.adobe.com/devnet/coldfusion/articles/coldfusion9_whatsnew.html

HTH again, Carl.

Legend
October 26, 2010

Hello,

Have not used MS Excel as a database. What you would need is an MS Excel JDBC type4 driver. In CFadmin UI select Data & Services > Data Sources then Add New Data Source and use Driver other. Put in the JDBC URL and Driver Class to match the details of the type4 driver file. You will need to add the JAR file that is the JDBC driver to the JVM arguments path (or via ColdFusion Class Path).

HTH, Carl.