Elizabeth.J.Doering at wellsfargo.com
Elizabeth.J.Doering at wellsfargo.com
Thu Oct 9 21:15:30 CDT 2008
David, You may have better success removing commas from all fields, all the time. CSVs are notorious for being comma separated! Either enforce farther back that commas can't be entered in the fields, or use Replace to get rid of them as you are exporting. HTH, Liz -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: Thursday, October 09, 2008 7:11 PM To: accessd at databaseadvisors.com Subject: [AccessD] Exporting/Importing CSV files Team, I am wanting to export fields into a CSV file. This I can do using Print #. I am also enclosing each field in single quotes thus: Print #lngFileHandle, "'DET','" & rst!Field1 & "','" & rst!Field2 & "','" & rst!Field3 & "'" Result: 'DET','1','Joe','Bloggs','10 Kingston Lane' I can also read the files back into an arrany using Input #: Input #lngFileHandle, strData(0), strData(2), strData(3), strData(4) This works fine unless one of the output fields includes a comma. Eg 'DET','1','Joe','Bloggs','10 Kingston Lane, Jamaca' In this case the Input# only gets "'10 Kingston Lane" and assumes that " Jamaca'" is for the next field. How do I allow for comma's to be included in fields? Regards David Emerson Dalyn Software Ltd Wellington, New Zealand -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation.