zoukankan
html css js c++ java
导出SQLServer数据到Excel中
<
%@ Language
=
VBScript%
>
<
html
>
<
head
>
<
meta http
-
equiv
=
"
Content-Type
"
content
=
"
text/html; charset=gb2312
"
>
<
title
>
导出SQLServer数据到Excel中
</
title
>
</
head
>
<
body
>
<
%
Response.Clear
Response.ContentType
=
"
text/xls
"
Response.AddHeader
"
content-disposition
"
,
"
attachment;filename=Excel.xls
"
'
生成Excel
Response.Write
"
编号
"
&
Chr
(
9
)
&
"
姓名
"
&
Chr
(
9
)
&
"
性别
"
&
Chr
(
9
)
&
"
年龄
"
&
Chr
(
13
)
Set
Conn
=
Server.CreateObject(
"
Adodb.Connection
"
)
ConnStr
=
"
Provider=SQLOLEDB.1;Persist Security Info=True;User ID=sa;Password=;Initial Catalog=Info;Data Source=127.0.0.1
"
Conn.Open ConnStr
Sql
=
"
SELECT * FROM INFO
"
Set
Rs
=
Conn.Execute(Sql)
Num
=
Rs.Fields.Count
Do
While
Not
Rs.Eof
MM
=
0
While
MM
<
CInt
(Num)
Data
=
Data
&
Rs(MM)
&
Chr
(
9
)
MM
=
MM
+
1
Wend
Response.Write Data
&
Chr
(
13
)
Data
=
""
Rs.MoveNext:
Loop
Set
Rs
=
Nothing
Conn.Close
Set
Conn
=
Nothing
Response.Flush
Response.End
%
>
</
body
>
</
html
>
青苹果Web应用商店
https://webapp.taobao.com/
PHP/ASP.NET/ASP/UCHOME/DISCUZ! X系列网站开发,详细需求联系
QQ:8511978
查看全文
相关阅读:
MySQL执行计划extra中的using index 和 using where using index 的区别
Python + Apache Kylin 让数据分析更加简单!
性能测试解读:Kyligence vs Spark SQL
greenplum 表在各个节点数据的分布情况
postgresql drop表后空间不释放
PostgreSQL 查看表、索引等创建时间
postgresql Kill掉正在执行的SQL语句
linux ps命令查看最消耗CPU、内存的进程
Linux shell
TPC-H 下载参考
原文地址:https://www.cnblogs.com/Dicky/p/389427.html
最新文章
Linux:软件包安装
Linux:进程
Linux 使用shell脚本实现自动SSH互信功能
MySQL分区表 非分区索引 无法使用
Linux 颜色设置
Mysql 碎片整理与统计信息收集
Shell中判断字符串是否为数字的6种方法分享
linux sed、awk、grep同时匹配多个条(并且 or 或者)
linux 登录后有时候会出现-bash-4.1$
greenplum 下载地址
热门文章
neo4j 启动与关闭
数据库基准测试标准 TPC-C or TPC-H or TPC-DS
Docker+GitLab+Jenkins+kubernetes实现DevOps 持续化集成和持续化部署概念图
mongodb Presto
Kafka kSQL sql查询
ps -p {pid} -o etime获取进程运行时间是如何计算出来的?
Linux命令:awk求和、平均值、最大最小值
postgresql 修改用户密码
Linux rpm安装指定安装路径
Kafka+kylin——kylin2.5.0流式构建
Copyright © 2011-2022 走看看