Link to home
Start Free TrialLog in
Avatar of PaulCutcliffe
PaulCutcliffeFlag for United Kingdom of Great Britain and Northern Ireland

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\Direct.com\Export.txt", True

The ExportToTextFile is the Export Specification I have previously created.

Any idea what's wrong here?

Thanks.
Avatar of rockiroads
rockiroads
Flag of United States of America image

Could it possibly be getting confused as your spec and source object have the same name?
Have u tried changing one of the names to something else to see what happens?

Avatar of PaulCutcliffe

ASKER

Yes, I've tried various names, but the result is the same.
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?
ASKER CERTIFIED SOLUTION
Avatar of puppydogbuddy
puppydogbuddy

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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. :-)

Avatar of puppydogbuddy
puppydogbuddy

You are welcome.  Glad I could help.