Code:
If trim(Session("rstAsset1"))<>"" then
sqlAssetList = trim(Session("rstAsset1"))
End if
Set objRIMSConn = Server.CreateObject("ADODB.Connection")
objRIMSConn.CommandTimeout=0
objRIMSConn.Open RIMS_CONNECT
Set rstAssetList = Server.CreateObject("ADODB.Recordset")
rstAssetList.Open sqlAssetList , objRIMSConn, 1, 3
bolNoData = rstAssetList.EOF and rstAssetList.BOF
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-Disposition", "Attachment; filename=Asset_Returned_List.xls"