Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select multiple search criteria + download to Excel Spreadsheet

Status
Not open for further replies.

redcare

Technical User
May 20, 2001
32
0
0
GB
Hi

I currently have a list of servers on my database that I can download onto an Excel spreadsheet.
The code is as follows:
==============================
<%
Dim oRS
' Script generates CSV file for procurement scorecards
Response.Buffer = TRUE
Response.ContentType = &quot;application/vnd.ms-excel&quot;
'Write column headings
response.write &quot;Server Name&quot; & vbTab & &quot;Site Code&quot; & vbTab & &quot;Serial Number&quot; & vbTab & &quot;Asset Number&quot; & vbCrLf

'on error resume next
Set oRS = objConn.Execute(&quot;select Name_of_server,Site_Code,Serial_Number,Asset_Number from Products order by Name_of_Server&quot;) ' select statement for export
if err <> 0 Then response.write err.description :response.end
Do Until oRS.EOF
'Write out the fields seperated by tabs
response.write oRS(&quot;Name_of_server&quot;) & vbTab & oRS(&quot;Site_Code&quot;) & vbTab & oRS(&quot;Serial_Number&quot;) & vbTab &oRS(&quot;Asset_Number&quot;) & vbCrLf
oRS.MoveNext
Loop
oRS.Close(): Set oRS = Nothing
objConn.close: set objConn = nothing
%>
====================================
Unfortunately this only outputs the 4 stated fields.

I have multiple search fields on the database e.g Name_of_server, Site_Code, Domain, DNS_Server,Support_Status,Server_Type etc etc
and what I would like to do is have the option to either view my search criteria normally through my web page as I do at the moment or select to download my search criteria to an Excel spreadsheet.

I hope this makes sense.

Regards
Redcare
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top