Hi
Please help a novice with SQL 2000.
Iam trying to export data into a spreadsheet from my browser window.
The code I have got only allows me to output certain fields.
Is there a way to dynamically input the fields I want to export when I click on the button.e.g by bringing up an input window.
I am using the following code.
==============================
<%
Dim oRS
' Script generates CSV file for procurement scorecards
Response.Buffer = TRUE
Response.ContentType = "application/vnd.ms-excel"
'Write column headings
response.write "Server Name" & vbTab & "Site" & vbTab & "Serial_Number" & vbCrLf
'on error resume next
Set oRS = objConn.Execute("select Name_of_server,Site_Code,Serial_Number from Products" ' 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("Name_of_server" & vbTab & oRS("Site_Code" & vbTab & oRS("Serial_Number" & vbCrLf
oRS.MoveNext
Loop
oRS.Close(): Set oRS = Nothing
objConn.close: set objConn = nothing
%>
Please help a novice with SQL 2000.
Iam trying to export data into a spreadsheet from my browser window.
The code I have got only allows me to output certain fields.
Is there a way to dynamically input the fields I want to export when I click on the button.e.g by bringing up an input window.
I am using the following code.
==============================
<%
Dim oRS
' Script generates CSV file for procurement scorecards
Response.Buffer = TRUE
Response.ContentType = "application/vnd.ms-excel"
'Write column headings
response.write "Server Name" & vbTab & "Site" & vbTab & "Serial_Number" & vbCrLf
'on error resume next
Set oRS = objConn.Execute("select Name_of_server,Site_Code,Serial_Number from Products" ' 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("Name_of_server" & vbTab & oRS("Site_Code" & vbTab & oRS("Serial_Number" & vbCrLf
oRS.MoveNext
Loop
oRS.Close(): Set oRS = Nothing
objConn.close: set objConn = nothing
%>