| "center">
点击这里生成excel
<%
if request("act")="" then
else
dim rs,sql,filename,fs,myfile,x
set fs=server.createobject("scripting.filesystemobject")
filename = server.mappath("data.xls")
if fs.fileexists(filename) then
fs.deletefile(filename)
end if
set myfile = fs.createtextfile(filename,true)
set rs = server.createobject("adodb.recordset")
sql = "Select mid(zgbm_no,1,6) as dzdm,dwmc as x01,xmmc as x02,frdm as a05,jsdz_bm as a03,v4 as x04,v5 as x05,v6 as x06,v7 as x07,v8 as x08,v9 as x09,v10_1 as x10,v11_1 as x11,v12 as x12,v13 as x13,v14 as x14,v15 as x15,v16 as x16,v17 as x17,v18 as x18,v19 as x19,dwfzr as xdw,tjfzr as xtj,tbr as xtb,rq as xrq FROM xmzb where zgbm_no like '"+session("zgbm_no")+"%' order by id desc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
else
dim strline,responsestr
strline=""
for each x in rs.fields
strline = strline & x.name & chr(9)
next
myfile.writeline strline
do while not rs.eof
strline=""
for each x in rs.fields
strline= strline & "="""&x.value """"& chr(9)
next
myfile.writeline strline
rs.movenext
loop
end if
response.write "生成成功!请 "+""+"点击这里下载"+""
rs.close
set rs = nothing
end if
%> |