Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How do I read Excel files in Coldfusion

Posted on 2004-10-06
7
Medium Priority
?
21,611 Views
Last Modified: 2013-12-20
After much searching I have decided to join EE so I might be able to solve my problem.

I got some code from my fellow developers to read a Excel file in Coldfusion but it no longer works in MX

<cfquery dbtype="dynamic" CONNECTSTRING="Driver={Microsoft Excel Driver (*.xls)};DriverId=790;Dbq=#Session.filepath#;DefaultDir=#Session.filepath#;" name="InputQuery">

Then I managed to find some COM object thing that is a Custom tag that suppose to do the same thing..{ReadXLS.cfm} but it also doesn't work

Is there anybody out there that can actually do this?

Custom Tag / CFFile / CFQuery .. I don't care.. I just need to get the excel file read into CF, after that I will split the data and validate it and write a text file out to do the rest of my process.. In a perfect world I would ask the end-users to actually save the Data Dumps as CSV but I can't and they will not do this... So I need to somehow read the DATA from the Excel file.

My next option is to just do it in PHP... but that would require a whole new system.. and I would rather find a solution to my current problem than re-write everything in PHP

Kind Regards
Adesso21
0
Comment
Question by:Adesso21
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
7 Comments
 
LVL 21

Accepted Solution

by:
pinaldave earned 500 total points
ID: 12239850
0
 
LVL 9

Expert Comment

by:Jerry_Pang
ID: 12244824
DNS-less connection is no longer supported in MX.

This site shows you some workarounds
[quote]
With the introduction of JDBC drivers in ColdFusion MX, dynamic data source connections (also referred to as DSN-less connections) are no longer supported. This is because ColdFusion MX uses the data source services provided by the underlying J2EE server. It is possible to closely simulate this functionality however.
[\quote]

Dynamic data sources in ColdFusion MX
http://www.macromedia.com/support/coldfusion/ts/documents/dynamic_dsn_cfmx.htm
0
 
LVL 9

Expert Comment

by:Jerry_Pang
ID: 12244854
<cfquery dbtype="dynamic" CONNECTSTRING="Driver={Microsoft Excel Driver (*.xls)};DriverId=790;Dbq=#Session.filepath#;DefaultDir=#Session.filepath#;" name="InputQuery">

is not supported anymore.

Either create an odbc and setup the administration area for the ODBC,
then change your <cfquery> to sumthing like
<cfquery name="InputQuery" datasource="Your_dnsname">

or use the workaround given by macromedia and modify your all queries
 like this
<cfquery name="test" datasource="dynamicMDB">
   SELECT FirstName
   FROM Employees
   IN 'C:\mysite\db\cfsnippets.mdb'
</cfquery

i would personally go for step one.
Setup the ODBC then modify the <cfquery tags>
0
Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

 
LVL 2

Author Comment

by:Adesso21
ID: 12246502
DNS-less connections is no longer supported...... NOT

http://www.emerle.net/programming/display.cfm/t/cfx_excel2query has a very nice solution to make this all possible..

The requirment was reading in files on a server in a on-going basis.. and this nice little CFX tag does just that.. no more worries as my problem has been solve thanks to pinaldave. I knew it was not all that tuff..

Thanks for the link and time guys.. My work here is done.

Kind Regards

Adesso21
0
 
LVL 2

Author Comment

by:Adesso21
ID: 12246540
PS > www.cfcomet.com no longer exist...
0
 
LVL 21

Expert Comment

by:pinaldave
ID: 12248706
glad to help you and have a good day,
Regards,
---Pinal
0

Featured Post

Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
The purpose of this video is to demonstrate how to connect a WordPress website to Google Analytics. This will be demonstrated using a Windows 8 PC Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php :…
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question