I haven't tested this but this might work for you. The second parameter is the 
query source. It's displayed when a query is dumped. The last parameter is the 
max rows. The default value is -1 which returns all rows.

myQuery = CreateObject('java', 
'com.naryx.tagfusion.cfm.engine.cfQueryResultData').init(rs, "EXCEL FILE", -1);

Paul

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of 
FrognutUnl
Sent: Monday, April 27, 2009 11:42 AM
To: Open BlueDragon
Subject: [OpenBD] Import Excel



I am trying to convert some code that I currently use with Adobe CF to
work on OpenBD to import excel files. Basically I was using the java
jdbc connector for excel.  Is there an equivalent for the java object
"coldfusion.sql.QueryTable"?


Here is how I am using it:

CreateObject('java','java.lang.Class').forName
('sun.jdbc.odbc.JdbcOdbcDriver');
c = CreateObject('java','java.sql.DriverManager').getConnection
('jdbc:odbc:Driver={Microsoft Excel Driver (*.xls)};DBQ=' &
arguments.filename );

stmnt = c.createStatement();
rs = stmnt.executeQuery(sql);
myQuery = CreateObject('java','coldfusion.sql.QueryTable').init(rs);


The file that would be processed would be uploaded by a user and may
have an assortment of names, so I don't really want to create an ODBC
connection from within windows if at all possible. Also would like to
NOT force the user to create a CSV, but that may be the easiest way to
skin this cat.



--~--~---------~--~----~------------~-------~--~----~
Open BlueDragon Public Mailing List
 http://groups.google.com/group/openbd?hl=en
 official site @ http://www.openbluedragon.org/

!! save a network - trim replies before posting !!
-~----------~----~----~----~------~----~------~--~---

Reply via email to