一个asp导出csv文件直接下载 的例子
时间:2007-03-06 10:15:41浏览:51591
Response.Buffer = true
Response.AddHeader \"Content-Disposition\",\"attachment; filename=member.csv\"
Response.CharSet = \"UTF-8\"
Response.ContentType = \"application/octet-stream\"
dim conn,rs,i
set conn = Server.CreateObject(\"Adodb.Connection\")
conn.open connectionstring
set rs = conn.Execute(\"select * from [User] order by [UserId]\")
Response.Write rs.fields(0).name
for i=1 to rs.fields.count-1
Response.Write \",\" & rs.fields(i).name
next
Response.Flush()
do while not rs.eof
Response.Write vbCrLf & rs(0)
for i=1 to rs.fields.count-1
Response.Write \",\" & rs(i)
next
Response.Flush()
rs.Movenext
loop
rs.Close
conn.Close
set rs = nothing
set conn = nothing
Response.End()
1上一篇:CHM版JAVADOC下载
下一篇:CN域名?玉米?垃圾?
- Linux文章
- PHP文章
- 随机文章
- Linux中的find(-atime...
- mysql的expire_logs_...
- PHP 扩展 libsodium s...
- Linux下利用find和cp实现筛...
- 使用mysqldump命令导出备份m...
- Linux系统如何设置开机自动运行脚...
- Linux上实现秒级执行的定时任务
- shell echo -e 颜色输出
- Linux下通过grep查找指定的进...
- 解决执行脚本报syntax erro...
发表评论
昵称: 验证码: