Transfer Text error (3011)

G

Guest

I have a table: Inspection_EXPORT with an export specification: RTM_export.
I want to export the table into a CSV file locally. I've written a function
in a module using Transfer.text to do this:

Public Function EXPORT_Inspections()

DoCmd.TransferText acExportFixed, "RTM_Export", "Inspection_EXPORT",
"c:\test.txt", True

End Function

I am getting this error:
Run-time error '3011':
"The Microsoft Office Access database engine could not find the object
'test#txt'. Make sure the object exists and that you spell its name and the
path name correctly.

---------
I have a few questions.
1- Why is the engine trying to make sure the future export file exists?
It's an exported file, it doesnt exist yet...
2- Why is it being referred to as 'test#txt'? Did I write the wrong syntax?
3- If I wanted a .CSV file, could I just name it test.csv- or do I need to
do something else?

Thanks for your patience and help.
 
R

Roger Carlson

Well, no. You're using a fixed export in the TransferText and CSV is a
delimited format. Here's what I would do:

1: Export the table as a CSV manually, creating and saving an Export
Specification in the process. (That is, only if you need it. The vanilla
Delimited export may work just fine.)
2. Create a macro using the TransferText action and fill in all the
arguments in the lower portion. Make sure you select Export Delimited in
the Transfer Type line.
3. Save the macro As a VB module. This will give you the correct syntax for
your DoCmd.TransferText line.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
G

Guest

I don't have the TransferText action in the drop down when I am building a
macro... Am I in the wrong place?

I've changed the acExportFixed to acExportDelim and changed the saved export
specificaiton to a delimited export. I still get the same error.

Any ideas?
 
G

Guest

Additionally when I try to manually export the file - then save the export
process (lets say export2) - when I try to reference that in my function:

DoCmd.TransferText acExportFixed, "export2", "Inspection_EXPORT",
"c:\test.txt", True

It gives me a run-time error 3625- that text file specification "export2"
does not exist.

Very confusing...
 
R

Roger Carlson

TransferText is a standard action in the macro builder. It's usually the
very last one on the list. I suggested the steps below because I'm not able
to see your query, export spec, and so forth. Is RTM_Export the name of your
export spec? Is Inspection_EXPORT the name of the table/query? Do you
actually want to export the fieldnames? Assuming these are correct, the
only other thing I'd try is to add an additional empty parameter at the end:

DoCmd.TransferText acExportDelim, "RTM_Export", "Inspection_EXPORT",
"c:\test.txt", True, ""


--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
G

Guest

Roger,

I think I'm closer now...

I converted the macro using transfer text to a module, then put a button on
my form that called another macro that calls the function RunExport().

Now I get a regular error (no error number):
The microsoft office access database engine could not find the object
'test#csv'. Make sure the object exists and that you spell its name and the
path name correctly.

This is still confusing since I am not trying to reference anything. My
path is simply c:\ and the file name is test.csv. There is no test file in
my c:\ - why does it keep wanting to reference a file that doesnt exist yet?

Thanks!



'------------------------------------------------------------
' RunExport
'
'------------------------------------------------------------
Function RunExport()
On Error GoTo RunExport_Err

DoCmd.TransferText acExportDelim, "RTM_export", "Inspection_EXPORT",
"c:\test.csv", True, ""


RunExport_Exit:
Exit Function

RunExport_Err:
MsgBox Error$
Resume RunExport_Exit

End Function
 
G

Gina Whipp

Do you have the tables MSysIMEXSpecs and MSysIMEXColumns? If yes, then in
the Specs one there should be the name of your specification file, what does
it say? If no then try the below line:

DoCmd.TransferText acExportFixed, , "Inspection_EXPORT", "c:\test.txt"
 
J

John Nurick

I'm guessing, but do you (or rather the user account under which
Access is running) have write permissions on C:\ ?
 
D

David Ritchie

I had a similar problem after making some changes to the underlying query. Try recreating the export file, this worked for me.

Good Luck
 
P

Paris Finley

The "#" shows up in the error when you've modified the export table/query by removing or adding a field(s) to it AFTER you created your export specifications.

Manually do the export one more time and save over the old specs.



jknol wrote:

Transfer Text error (3011)
14-Aug-07

I have a table: Inspection_EXPORT with an export specification: RTM_export.
I want to export the table into a CSV file locally. I have written a function
in a module using Transfer.text to do this:

Previous Posts In This Thread:

Transfer Text error (3011)
I have a table: Inspection_EXPORT with an export specification: RTM_export.
I want to export the table into a CSV file locally. I have written a function
in a module using Transfer.text to do this:

Well, no.
Well, no. You're using a fixed export in the TransferText and CSV is a
delimited format. Here is what I would do:

1: Export the table as a CSV manually, creating and saving an Export
Specification

I don't have the TransferText action in the drop down when I am building a
I do not have the TransferText action in the drop down when I am building a
macro... Am I in the wrong place?

I have changed the acExportFixed to acExportDelim and changed the saved export
specifica

Additionally when I try to manually export the file - then save the export
Additionally when I try to manually export the file - then save the export
process (lets say export2) - when I try to reference that in my function:

DoCmd.TransferText acExportFixed, "export2", "Insp

TransferText is a standard action in the macro builder.
TransferText is a standard action in the macro builder. it is usually the
very last one on the list. I suggested the steps below because I am not able
to see your query, export spec, and so forth. I

Roger,I think I'm closer now...
Roger,

I think I am closer now...

I converted the macro using transfer text to a module, then put a button on
my form that called another macro that calls the function RunExport().

Now I get a regu

Well, unfortunately, it's got me stumped.
Well, unfortunately, it is got me stumped. If no one else answers in a
couple of days, try re-posting.

Sorry.


--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com

Do you have the tables MSysIMEXSpecs and MSysIMEXColumns?
Do you have the tables MSysIMEXSpecs and MSysIMEXColumns? If yes, then in
the Specs one there should be the name of your specification file, what does
it say? If no then try the below line:

DoCmd.T

I'm guessing, but do you (or rather the user account under whichAccess is
I am guessing, but do you (or rather the user account under which
Access is running) have write permissions on C:\ ?

wrote:

--
John Nurick - Access MVP

Recreate the export file
I had a similar problem after making some changes to the underlying query. Try recreating the export file, this worked for me.

Good Luck

EggHeadCafe - Software Developer Portal of Choice
Visual Basic And FTP Project Sample
http://www.eggheadcafe.com/tutorial...b-cfe42b6ff731/visual-basic-and-ftp-proj.aspx
 

cpc

Joined
Jan 19, 2012
Messages
1
Reaction score
0
I encountered this problem and ultimately concluded that my saved export format no longer matched the table I was exporting. To see if this is your problem, simply open the table you are exporting and try to export it through the export wizard. When you get the chance, call up your save export format and continue with the export. Access will probably tell you about the field it does not recognize. Error 3011 is obviously a very misleading message. It has nothing to do with "not finding" the file name you are trying to export.
 
Joined
Aug 3, 2012
Messages
3
Reaction score
0
I had a similar problem after making some changes to the underlying query. Try recreating the export file, this worked for me.

Good Luck

----------

After encountering the exact same error as the first poster in this thread ("...file not found...") and then much trial and error, this (above) was the solution.

I recreated the table (from which the export is done) and then recreated the export specification. (I had made a change to the query that populated the table and this is ultimately what caused the problems.)

After recreating these objects, the code ran just fine.

Wouldn't it be nice if the Access errors were helpful? Many or most of them are not.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

3011 - Transfertext 2
File names causing a problem 6
Transfer Text and Windows Vista 5
Message 3011 2
Transfer spreadsheet error 4
Error 3011 3
delimiter problem 1
Run-time error '3011' 1

Top