Link to home
Start Free TrialLog in
Avatar of Jerry_Pang
Jerry_Pang

asked on

how to export from SQL query to excel - no 'COM' - objects please.

no use of COM objects please.

i found it the other day here on experts exchange. it was using "file content" or sumthing.
having trouble finding it.

i need a function - passed a query and the file name.


ASKER CERTIFIED SOLUTION
Avatar of anandkp
anandkp
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jerry_Pang
Jerry_Pang

ASKER

hi,

was wondering

do you know how to

select fieldnames from tables ?


im planning to modify thie
"<CFOUTPUT QUERY="get_Data">
#Currentrow##TAB##username##TAB##EMail##chr(13)#
</CFOUTPUT>"

to cycle through the fieldnames.
got it

"select * from syscolumn a left join systable b on a.table_id = b.table_id where b.table_name ='tablename'"

thanx..
be working on this now.
u cld use "query.columnlist"

this wld give u all the columns

K'Rgds
Anand
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
well, you can't really produce a real "excel" file without using COM.  the format is proprietary.   the best you can do is put it in csv or tab delimited or some other format excel knows, and then open the file in excel and save it as an xls... otherwise you can't do it without accessing excels object model.
substand, if you send data via http and stick in some cfcontent type="application/msexcel" headers, Internet Explorer running on Windows will generally try to display the data in Excel, at which point the user can Save As or whatever and their local copy of Excel will make it a real Excel file. The problem is, as always, the exceptions. Some people will have altered their mime types so that this can't happen. Some people will be running other browsers or non-Windows systems. In my opinion non-formatted Excel files produced this way are very much non-optimal, but if the programmer can't/won't do COM and the user is demanding Excel, this method is the best bet.
i agree with that...   i just wanted Jerry to know that this was not a file in the .xls format
of i see...

was experimenting with com objects and having lots of trouble unloading and endtasking it.
i have to restart the computer if ever error occurs in the middle, i mean failed to quit/end the excel object.

having trouble with task manager, lots of excel is running at the same time.

i want to know if there was a way to generate an excel file without COM object.
or sql to excel using a third party tools or anything.
im looking for different ways of doing it, also looking for pro's and con's
my biggest problem with com is that excel process doesnt end. i have to restart computer.

CFMX Bugs

COM/DCOM
49840 When calling the Excel COM object, even after the page is finished and excel.quit is called, the Excel process still exists.

no release date of update yet.

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
found sumthing from the Macromedia site.
CFX_EXCEL