Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read Excel file

Status
Not open for further replies.

OldWilly

Programmer
Mar 1, 2002
66
0
0
I am trying to read an Excel file called "email.xls".
I set up my CF Admin ODBC connection using Microsoft Excel Driver (*.xls). DSN = "xls". I put in Workbook/Directory ...
c:\Inetpub\ (the directory where the email.xls file exists) .. and it verfies ok.
Then in my CF code:
<cfquery datasource=&quot;xls&quot; name=&quot;email&quot;>
SELECT * FROM email
</cfquery>
This code fails. Can anyone tell me what I am doing wrong?
I notice that CF Admin offers Excel version 97-2000 and lower. The Excel on my PC is 8.0 (I don't know if it makes a difference).
 
Sometimes you have to drop it to a csv file. I couldn't get a similar situation to work for the life of me. Then you import it into the database and do it that way.

To ease the process, my friend wrote a little program to do it for me so I could update the file without repeating the steps.

 
8.0?? Is that aka 2002?

Anyway... a couple of things that might do it...

a) your query name is the same as your table name. That can't be a good thing. I'd change the name of your query to something else.

b) is &quot;email&quot; the name of the file, the workbook, or the individual sheet? I believe the syntax needs to be something like:

select * from [email$]

assuming &quot;email&quot; is your sheet name (the name of the file is defined in the connection, and the name of the workbook is actually ignored).
Hope it helps,
-Carl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top