I have an access database which manipulates data from a Magento e-commerce store, reformats the data and (hopefully!) spits out a CSV file which can then be imported into ebay Turbolister for mass upload to eBay.
I have got as far as creating a query which correctly lays out the data into the format required by Turbolister.
My issues are various (including some which appear to be related to Access’ handling of large field contents), however the crux of my problem is that I am struggling to get working a simple script which exports the query results as a properly formatted CSV (including doubling up on double quotes where required inside a text value i.e. if the value itself contains quotes which need to be retained).
The DoCmd.TransferText solution throws an error related to field size (‘the field is too small to accept the amount of data you attempted to add’) so thats no good.
Has anyone got a good working CSV export routine in VBA that they can suggest?
Cheers
This is an old function I sometimes used to use, it allows you to specify the delimeter, it also checks the data it’s outputting and if it can’t be evaluated to either a date or a numeric etc, then it uses double quotes:
It may need a couple of tweaks as I’ve taken out some bits which were only relevant to my particular case but this may be a starting point.