[AccessD] Exporting/Importing CSV files

David Emerson newsgrps at dalyn.co.nz
Thu Oct 9 19:10:30 CDT 2008


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 




More information about the AccessD mailing list