?
Solved

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'

Posted on 2006-07-10
6
Medium Priority
?
507 Views
Last Modified: 2012-05-05
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.
0
Comment
Question by:PaulCutcliffe
  • 3
  • 2
6 Comments
 
LVL 65

Expert Comment

by:rockiroads
ID: 17073502
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?

0
 

Author Comment

by:PaulCutcliffe
ID: 17073793
Yes, I've tried various names, but the result is the same.
0
 

Author Comment

by:PaulCutcliffe
ID: 17074124
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?
0
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 
LVL 38

Accepted Solution

by:
puppydogbuddy earned 1000 total points
ID: 17074663
According to Access help, you are supposed to use acExportFixed, acExportDelim, acExportHTML, or acExportMerge as the transfer type.....and presented the following example:

TransferText Method Example
The following example exports the data from the Microsoft Access table External Report to the delimited text file April.doc by using the specification Standard Output:

DoCmd.TransferText acExportDelim, "Standard Output", _
    "External Report", "C:\Txtfiles\April.doc"


Assuming you have a delimited file, your syntax should be:

DoCmd.TransferText acExportDelim, "ExportToTextFile", "ExportToTextFile", "\\Ukenetsrv01\clients\Direct.com\Export.txt", True
0
 

Author Comment

by:PaulCutcliffe
ID: 17077770
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. :-)

0
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 17077878
You are welcome.  Glad I could help.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Suggested Courses
Course of the Month13 days, 17 hours left to enroll

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question