codice:
<%@LANGUAGE="VBSCRIPT"%>
<%option explicit%>
<%
Dim Item, mesePreExp, annoPreExp, areaPreExp, strSql, rs
mesePreExp = trim(request.Form("mesePreExp"))
annoPreExp = trim(session("AnnoScelto"))
areaPreExp = trim(request.Form("areaPreExp"))
StrSql = "SELECT * FROM MYTABLE"
set rs = server.CreateObject("ADODB.recordset")
rs.Open strSql, objcnn, 3, 3
Dim filename
filename = "Pianificazione" & UCase(Left(MonthName(mesePreExp), 1)) & LCase(Right(MonthName(mesePreExp), Len(MonthName(mesePreExp)) - 1)) & areaPreExp
Response.Buffer = True
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "content-disposition", "inline; filename=" & filename & ".xls"
Response.Write "<table border='1' bordercolor='#000000'>"
Response.Write "<tr bgcolor='#999999'>"
For Each Item in rs.Fields
Response.Write "<td>"
Response.Write Item.Name
Response.Write "</td>"
Next
Do While not rs.Eof
Response.Write "<tr nowrap>"
For Each Item in rs.Fields
Response.Write "<td nowrap>"
Response.Write Item.Value
Response.Write "</td>"
Next
Response.Write "</tr>"
rs.MoveNext
Loop
Response.Write "</table>"
Response.Flush
objcnn.Close
Set objcnn = Nothing
%>
Questo è tutto il mio file