PaulCutcliffe
asked on
I am having trouble Exporting from an Access Table to a Text File - Ihave created an Export Specification that works manually in Access, but my VBA Code Complains with a Run-time error '3442'
I am trying to automate the exporting of some data from a Table to a Test File. The data is actually created by a Query, but because I have some Memo fields of more than 255 characters, I have had to make the Query an Append Query, & my code firstly removes all Rows from the Table, then runs the Query to repopulate the Table.
If I Export the data from this Table manually, it works just fine, using the Export Specification I have created previously. However, if I run my VBA Code, I get the following error:
"Run-time error '3442':
In the text file specification 'ExportToTextFile', the ExtendedInfoText option is invalid."
Here is my VBA Code:
DoCmd.TransferText acExport, "ExportToTextFile", "ExportToTextFile", "\\Ukenetsrv01\clients\Dir ect.com\Ex port.txt", True
The ExportToTextFile is the Export Specification I have previously created.
Any idea what's wrong here?
Thanks.
If I Export the data from this Table manually, it works just fine, using the Export Specification I have created previously. However, if I run my VBA Code, I get the following error:
"Run-time error '3442':
In the text file specification 'ExportToTextFile', the ExtendedInfoText option is invalid."
Here is my VBA Code:
DoCmd.TransferText acExport, "ExportToTextFile", "ExportToTextFile", "\\Ukenetsrv01\clients\Dir
The ExportToTextFile is the Export Specification I have previously created.
Any idea what's wrong here?
Thanks.
ASKER
Yes, I've tried various names, but the result is the same.
ASKER
If I remove one of the last two columns (quite big, come from Memo fields), then it exports perfectly, using my same VBA Code.
Are there limits that somehow only apply to these Export Specifications, but only when used in Code?
Are there limits that somehow only apply to these Export Specifications, but only when used in Code?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
puppydogbuddy: Excellent, that works a treat!
I hadn't spotted that, & even if I had, would probably have assumed that I didn't need to specify 'Delimited' there, as I was using an Export Specification that stated it was delimited, & it did work fine with just one less Memo field in.
Anyway, thanks for sorting that. :-)
I hadn't spotted that, & even if I had, would probably have assumed that I didn't need to specify 'Delimited' there, as I was using an Export Specification that stated it was delimited, & it did work fine with just one less Memo field in.
Anyway, thanks for sorting that. :-)
You are welcome. Glad I could help.
Have u tried changing one of the names to something else to see what happens?