<%@ CODEPAGE="65001" LANGUAGE="VBScript" %>
<%
Response.Buffer = True
Response.ContentType = "application/vnd.ms-excel"
Response.Charset = "utf-8"
Response.AddHeader "Content-Disposition", "attachment; filename=rep2xls.xls"
Response.Write "<table>"
sql = "SELECT * from orders WHERE MyStatus>0 order by id desc"
set rs1 = conn.execute(sql)
while not rs1.eof
itemQprice = rs1("itemQprice")
quantity = rs1("quantity")
prdPrice = rs1("prdPrice")
Response.Write "<tr>" & _
"<td>" & itemQprice & "</td>" & _
"<td>" & quantity & "</td>" & _
"<td>" & prdPrice & "</td>" & _
"</tr>"
rs.movenext
wend
Response.Write "</table>"
Response.end
%>
live demo
Other MIME type or ContentType
|