28,391
社区成员
发帖
与我相关
我的任务
分享
<%
dt = Request("日期字段")
sql = "查询语句 "
Set conn = CreateObject("ADODB.Connection")
conn.Open "xxxxxx"
Set rs = CreateObject("ADODB.RecordSet")
rs.CursorLocation = 3
rs.Open sql, conn, 1, 1
if not (rs.eof and rs.bof) then
s = rs.GetString(2,,VBTab,VBCrLf,"")
end if
rs.close
conn.close
set rs = nothing
set conn = nothing
With Response
.Charset = "GB2312"
.ContentType = "application/octet-stream"
.AddHeader "Accept-Ranges", "bytes"
.AddHeader "Content-Length", LenB(s)
.AddHeader "Content-Type", "application/octet-stream"
.AddHeader "Content-Disposition","attachment; filename=xxxx.xls"
.BinaryWrite s
End With
%>