[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Coldfusion Excel Datasource reading in blank string when a number is encountered

Posted on 2008-10-01
7
Medium Priority
?
435 Views
Last Modified: 2013-12-24
I have an excel 5.0/95 spreadsheet set up as a datasource for a Coldfusion script. It can read from the file using the following SQL command:

select password from [worksheet$] in 'C:\datasources\sheet.xls' 'EXCEL 5.0;';

And then I dump it using cfdump.

The problem is that when it encounters a number in the sheet, it does not read it in and displays '[empty string]'. I have tried formatting the column as both text and general and it does not seem to make any difference. I know that I can fix the problem by putting a single quote mark in front of the number in the spreadsheet, but this is not a practical solution as this is a regular task and will take a lot of time to go through and do this each time. I need to find a programatic solution.

Any suggestions?
0
Comment
Question by:dale_abrams
[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
  • 3
  • 3
7 Comments
 
LVL 19

Expert Comment

by:erikTsomik
ID: 22618215
0
 
LVL 1

Author Comment

by:dale_abrams
ID: 22619298
Thanks Erik.

I tried the solution on that page and am getting a syntax error in the from clause.

Here is the new query that I tried...


select * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=C:\datasources\sheet.xls;HDR=Yes;IMEX=1', 
'select * from [worksheet$]');

Open in new window

0
 
LVL 19

Expert Comment

by:erikTsomik
ID: 22619361
0
Simplify Your Workload with One Tool

How do you combat today’s intelligent hacker while managing multiple domains and platforms? By simplifying your workload with one tool. With Lunarpages hosting through Plesk Onyx, you can:

Automate SSL generation and installation with two clicks
Experience total server control

 
LVL 1

Author Comment

by:dale_abrams
ID: 22619508
That forum did not apply to my problem.

I was able to find my solution on a different site through google searching though. The final working query was

SELECT * FROM "Excel 8.0; DATABASE=C:\datasources\sheet.xls; HDR=YES;IMEX=1".[worksheet$];
0
 
LVL 19

Expert Comment

by:erikTsomik
ID: 22621080
the link that i posted very closely shows the solution. And it was a big help to you
0
 
LVL 1

Accepted Solution

by:
dale_abrams earned 0 total points
ID: 22621290
The link you posted utilized a completely different method, and after trying that method and running into a whole new set of roadblocks, I went and searched and found an answer myself. I appreciate your help, but would ask that you do more than search the forums and post a link. That defeats the purpose of having a site like Experts-Exchange where people can get direct code examples to their questions. Had you taken the time to do this, I would have given you partial points for taking the time to attempt to help me.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

649 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