28,390
社区成员
发帖
与我相关
我的任务
分享
<!--#include file="conn.asp"-->
<%
Dim rs, strLine, sql, filename, fs, myfile
strLine = ""
strLine = strLine & "序号" & chr(9)
strLine = strLine & "项目权属" & chr(9)
strLine = strLine & "项目名称" & chr(9)
strLine = strLine & "项目简介" & chr(9)
strLine = strLine & "合作方式" & chr(9)
strLine = strLine & "项目投资总额" & chr(9)
strLine = strLine & "项目单位" & chr(9)
strLine = strLine & "联系人" & chr(9)
strLine = strLine & "联系方式" & chr(9)
strLine = strLine & "分类" & chr(9)
strLine = strLine & VbCrLf
sql = "SELECT hyid,xmcs,xmmc,xmjj,hzfs,xmtzze,xmdw,lxms_lxw,lxms_dh,fl FROM [hyclub] ORDER BY hyid DESC"
Set rs = CreateObject("ADODB.Recordset")
rs.CursorLocation = 3
rs.Open conn, sql, 1, 1
If Not (rs.EOF And rs.BOF) Then
strLine = strLine & rs.GetString(2, -1, VbTab, VbCrLf, "")
End If
rs.Close
Set rs = Nothing
conn.Close
Set conn = Nothing
filename = Server.MapPath("2018918.xls")
Set fs = CreateObject("Scripting.FileSystemObject")
Set myfile = fs.OpenTextFile(filename, 2, True, -1)
myfile.Write strLine
myfile.Close
Set myfile = Nothing
Set fs = Nothing
Response.Write "<br> 生成EXCEL文件成功,点击<a href=""2018918.xls"" target=""_blank"">下载</a>~"
%>