Looking for the export specification of a textfile

odrap

Registered User.
Local time
Today, 19:11
Joined
Dec 16, 2008
Messages
156
Sometimes i need to send a table of my database to another database on another computer. To solve this problem i export the table to a textfile, and after that i put this textfile as a attachment on a email which i send to the destination. For most of the tables i need to send, everything is going fine, except for one table who has a lot of fields, inclusive fields of memo type.
Some records has fields with no value. The textfile is a comma delimited file with the fieldnames in the first row.
When i look to the result it seems to be a mess. When i try to import this textfile back into a table,as this is what has to be done on the destination side, I get a message , sometimes telling me that an error occured and i get a kind of errortable telling me that some fields are truncated, sometimes some values occur in the wrong fields.
When i make the export choosing the option as shown in the picture- see inclusive jpeg -, i get a good result. Clicking on the saved exportspecification button on the ribbon and choosing there the name of gave for this export works fine. However,when I use this name in my DoCmd.Transfertext as exportspecification parameter,an error occurs, telling me that this exportspecification parameter is wrong. Where can i find the exportspecificationparameter for this saved export in order to get the whole thing done by vba code?
 

Attachments

  • Exporting_textfile.jpg
    Exporting_textfile.jpg
    49.1 KB · Views: 129
I suspect from what you are saying is that the problem only occurs on tables that contain memo type fields. If this is the case the issue may relate to the fact that the memo fields contain the characters you are using as a delimter. such as a comma. When reading the string in it effectively splits the memo field into degments and treats them as individual fields.

The solution would be to use a character such as a pipe | as the delimter. It would be unlikely that the memo field would contain such a character. You could also do a replace to find invalid characters in the memo field.

David
 

Users who are viewing this thread

Back
Top Bottom