开发者

Display query result and export to excel using classic asp

开发者 https://www.devze.com 2023-01-15 10:04 出处:网络
I\'m working on a small project regarding classic ASP and sql server. I have a drop down menu where the user can enter name, last name, etc. and it will create a query based on that and create a tabl

I'm working on a small project regarding classic ASP and sql server.

I have a drop down menu where the user can enter name, last name, etc. and it will create a query based on that and create a table displaying the result.

What I want to add is the option to export to excel after the table is create开发者_开发技巧d. I've looked at other tutorials but they all use the simple Select * from table rather than a query based on user input.

can anyone help on this?


add

response.contenttype ="Application/vnd.excel"
response.addheader "Content-Disposition", "attachment; filename=excelDatei.xls"

and the browser opens the save/open/cancel dialog...

is that what you want?


Solved my question which dealt more with how to use this code. What I ended up doing is storing the SQL query in a session variable and creating a link to a new ASP page that will connect to the database, create the Excel object, and output to it.

0

精彩评论

暂无评论...
验证码 换一张
取 消