enclosing csv fields in quotes

T

Tim Cowan

Hi

I am trying to create a CSV file with some fields in double quotes ("). I am
not having any luck.

This is what I want;

"8684","COSTING","000010001","REG",X4,15.00, ,14,0,14,9,6

I am not sure how to create the double quotes. The ASP is this;

strTemp = rsCAExport.Fields("Employer Number") & "," & _
rsCAExport.Fields("Import Type ID") & "," & _
rsCAExport.Fields("Employee Number") & "," & _
rsCAExport.Fields("Cheque Type") & "," & _
rsCAExport.Fields("Code") & "," & _
rsCAExport.Fields("Value") & "," & _
rsCAExport.Fields("Distribution") & "," & _
rsCAExport.Fields("Rate") & "," & _
rsCAExport.Fields("Premium") & "," & _
rsCAExport.Fields("Day") & "," & _
rsCAExport.Fields("Pay Period") & "," & _
rsCAExport.Fields("Batch ID") & VBCrLf

Can anyone help?

Thanks

Tim Cowan
 
L

Lance Wynn

maybe something like this (untested):

strTemp = quoteField(rsCAExport.Fields("Employer Number")) & "," & _
quoteField(rsCAExport.Fields("Import Type ID")) & "," & _


function quoteField(sField)
quoteField="""" & sField & """"
end function

Hi

I am trying to create a CSV file with some fields in double quotes ("). I am
not having any luck.

This is what I want;

"8684","COSTING","000010001","REG",X4,15.00, ,14,0,14,9,6

I am not sure how to create the double quotes. The ASP is this;

strTemp = rsCAExport.Fields("Employer Number") & "," & _
rsCAExport.Fields("Import Type ID") & "," & _
rsCAExport.Fields("Employee Number") & "," & _
rsCAExport.Fields("Cheque Type") & "," & _
rsCAExport.Fields("Code") & "," & _
rsCAExport.Fields("Value") & "," & _
rsCAExport.Fields("Distribution") & "," & _
rsCAExport.Fields("Rate") & "," & _
rsCAExport.Fields("Premium") & "," & _
rsCAExport.Fields("Day") & "," & _
rsCAExport.Fields("Pay Period") & "," & _
rsCAExport.Fields("Batch ID") & VBCrLf

Can anyone help?

Thanks

Tim Cowan
 
B

Bullschmidt

Puzzle 5 Not much different from other solutions by Manohar Kamath
posted 1/12/99
http://www.asp101.com/puzzles/puzzle5_s7.asp

Puzzle 5 "Write delimited data to browser window" by Kirk Lockhart
posted on 12/21/98
Write the data in plain text to the browser window, and the user can
save the results as a plain text file and then import the data into
Excel or whatever application they want.
http://www.asp101.com/puzzles/puzzle5_s1.asp

Creating the Excel File Server Side
http://www.greggriffiths.org/webdev/both/excel/serverside.html
Uses FSO to create a .csv file.

http://www.aspmessageboard.com/forum/moderatedadvanced.asp?M=353414&F=31
&P=1
CSV Summary - What I Found Out

Best regards,
J. Paul Schmidt, Freelance ASP Web Designer
http://www.Bullschmidt.com
ASP Designer Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top