最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
数据库导出xml、htm、csv、sql
时间:2022-06-30 10:44:55 编辑:袖梨 来源:一聚教程网
'数据库导出记录代码
'作者海娃,haiwa#,http://www.51w**in*dows.Net
'用法:
'ExportDB.asp?sql=select语句&tablename=表名(可选)&filetype=导出格式(xml,htm,csv,sql)&pid=自动编号字段名(仅当导出sql类型时有用)
dim tablename,filetype,fieldPid
sql = request("sql")
tablename = request("tablename")
filetype = lcase(request("filetype"))
fieldPid = request("pid")
if fieldPid = "" then
fieldPid = "id"
end if
fieldPid = lcase(fieldPid)
if lcase(left(sql,6))"select" then
Response.write "sql语句必须为select * from [table] where ......."
Response.end
end if
if tablename = "" then
tablename = "数据导出结果"
end if
function HTMLEncode(fString)
if not isnull(fString) then
fString = Server.HTMLEncode(fString)
fString = Replace(fString, CHR(10) & CHR(10), "
")
fString = Replace(fString, CHR(10), "
")
fString = Replace(fString, CHR(9), " ")
HTMLEncode = fString
end if
end function
function Myreplace(str)
if not isnull(str) then
fString = Replace(fString,"""", """""")
Myreplace = str
else
Myreplace = ""
end if
end function
function Myreplace2(str)
if not isnull(str) then
fString = Replace(fString,"'", "''")
Myreplace2 = str
else
Myreplace2 = ""
end if
end function
dim def_export_sep,def_export_val
def_export_sep = ","
def_export_val = """"
Set rs = Conn.Execute(sql)
相关文章
- 无主之地4支线适配肢体伴侣治疗怎么做 支线适配肢体伴侣治疗图文攻略 09-16
- 原神6.0新增食谱是什么 6.0挪德卡莱新食谱大全 09-16
- 魔兽世界刀锋山矿点有哪些-刀锋山矿点位置介绍 09-16
- 原神挪德卡莱供奉点位在哪 挪德卡莱供奉点位置分享 09-16
- 无主之地4支线任务适配肢体怎么做 支线任务适配肢体图文攻略 09-16
- 崩坏星穹铁道3.6版本抽数统计一览 09-16