I have a script generate a CSV file from a table.
When I use as address, the CSV file will begin with
<!--METADATA TYPE="ASP_DEBUG_INFO"-->
If I use the real address the CSV file won't gebin with <!--METADATA TYPE="ASP_DEBUG_INFO"-->
My question is that how to get rid of the <!--META.....--> when using address?
Thanks
<%
Response.ContentType = "application/csv"
Response.AddHeader "Content-Disposition", "filename=mydata.csv;"
Dim objConn, RS, FSO, field
Set FSO = Server.CreateObject("Scripting.FileSystemObject"
openDB() '//Open a database connection
Set RS = objConn.Execute("Select * from tractSvr order by tractName"
dim i
Do While Not RS.EOF
i=0
For Each Field In RS.Fields
i=i+1
if i<RS.fields.count then
If IsNull(Field) Then
Response.Write """" & """" & ","
Else
Response.Write """" & Field.Value & """" & ","
End If
Else'last field ommit ,
If IsNull(Field) Then
Response.Write """" & """"
Else
Response.Write """" & Field.Value & """"
End If
End if
Next
Response.Write vbcrlf
RS.MoveNext
Loop
%>
When I use as address, the CSV file will begin with
<!--METADATA TYPE="ASP_DEBUG_INFO"-->
If I use the real address the CSV file won't gebin with <!--METADATA TYPE="ASP_DEBUG_INFO"-->
My question is that how to get rid of the <!--META.....--> when using address?
Thanks
<%
Response.ContentType = "application/csv"
Response.AddHeader "Content-Disposition", "filename=mydata.csv;"
Dim objConn, RS, FSO, field
Set FSO = Server.CreateObject("Scripting.FileSystemObject"
openDB() '//Open a database connection
Set RS = objConn.Execute("Select * from tractSvr order by tractName"
dim i
Do While Not RS.EOF
i=0
For Each Field In RS.Fields
i=i+1
if i<RS.fields.count then
If IsNull(Field) Then
Response.Write """" & """" & ","
Else
Response.Write """" & Field.Value & """" & ","
End If
Else'last field ommit ,
If IsNull(Field) Then
Response.Write """" & """"
Else
Response.Write """" & Field.Value & """"
End If
End if
Next
Response.Write vbcrlf
RS.MoveNext
Loop
%>