prova così
codice:
if Request.Form("excel") = "EXCEL" then
nomefile=request.form("name")
' estraggo i dati
Set rs = OBJdbConnection.Execute("SELECT * FROM fatture where idfattura like '"&idfattura&"'")
strTab = "<table border=1><tr>"
for each field in rs.Fields
strTab=strTab & "<td>" & field.name & "</td>"
next
strTab=strTab & "</tr>" & vbCrLf & "<tr><td>"
righe = rs.GetString(,,"</td><td>","</td></tr>" & vbCrLf & "<tr><td>", "NULL")
righe = Left(righe,Len(righe)-8)
strTab=strTab & righe & "</table>"
' chiusura
rs.Close
set rs = Nothing
OBJdbConnection.Close
set OBJdbConnection = Nothing
' modifico header per forzare l'apertura in Excel
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "content-disposition", "inline; filename="& nomefile & ".xsl"
' scrivo a video
'Response.Write ("<table><tr><td>" & risultato & "</td></tr></table>")
end if