By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,218 Members | 1,498 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,218 IT Pros & Developers. It's quick & easy.

enclosing csv fields in quotes

P: n/a
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
Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
maybe something like this (untested):

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

"Tim Cowan" <ti**@peopletogo.com> wrote in message
news:Ov*******************@news20.bellglobal.com.. .
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

Jul 19 '05 #2

P: n/a
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/...erverside.html
Uses FSO to create a .csv file.

http://www.aspmessageboard.com/forum...?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!
Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.