# Database Discussions > Microsoft Access >  Export from a table (transfer text)

## Wog

I've used DoCmd.transfer text with other projects to export a table in Access to a text file, and I am trying to do the same here, but with no success.



```
Public Function EXPORT_Inspections()


    DoCmd.TransferText acExportFixed, "Export1", "Inspection_EXPORT", "c:/exp.txt", True, ""
        

End Function
```

I keep getting:
The Microsoft Access database engine could not find the object <name>. Make sure the object exists and that you spell its name and the path name correctly. (Error 3011)

Anybody have an idea about that?

Thanks,
J

----------


## Allan Murphy

In your code

DoCmd.TransferText acExportFixed, "Export1", "Inspection_EXPORT", "c:/exp.txt", True, ""

Is Export1 your Specification Name?

"c:/exp.txt" should be "c:*\*exp.txt"

----------


## Wog

Yes, I've got a fixed width table specification with the name Export1.  

Weird, I'm still getting the errors after those changes....

----------


## GolferGuy

I believe the statement is looking for the HTML table name, but you have identified that table name as a zero length string by putting the comma and the two double quotes at the end of your statement.  Try this statement:

```
DoCmd.TransferText acExportFixed, "Export1", "Inspection_EXPORT", "c:\exp.txt", True
```

----------


## Wog

It's still not working, and I am trying to understand this error code and message without any success.

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.

Why is it trying to find 'test#txt'?  I don't need it to find test#txt, I need it to export a table to a fixed width file.  Anyone have any ideas?

(thanks for your help)

----------


## GolferGuy

Please post the latest statement you are using that is giving you the error.  Thanks!

----------


## Wog

Sorry about that- it basically hasn't changed except for the end.

Public Function EXPORT_Inspections()


    DoCmd.TransferText acExportFixed, "RTM_Export", "Inspection_EXPORT", "test.txt", True


End Function

--------
RTM_Export is the specification name...

----------


## GolferGuy

I would suggest putting the C:\ back into the name of the output file:  "C:\Test.txt" rather than just "test.txt".

I also notice you have changed the name, or changed what output specs you are using.  At first it was Export1, but now the name is "RTM_Export"  Did you just rename Export1 to RTM_Export, or did you create a new specification?  Have you reviewed the specification closely?

----------


## Wog

Sorry about that.  "RTM_export" is the table specification.  I was trying to be as general as possible.  I also changed the file back to c:\.  Still the same error.  It's so confusing- because it seems like it is trying to reference the file in the location instead of just exporting it.

----------


## GolferGuy

Will, could you show us the export specifications (RTM_export).  I would like to see a screen print for that if you know how, otherwise, just do a hand copy the best you can.  Also, 4 to 5 sample records of the query or table you are trying to export, with the field names included.  Suggest you select 4 or 5 records, copy them to the clipboard, then paste them into an Excel spreadsheet, then do a screen print of the Excel spreadsheet.

Does the file C:\Text.txt alread exist?

----------


## Wog

c:\test.txt does not exist.

Attached are 3 screenshots.  Table export specs, and the actual table (I couldnt get all the fields in the shot, but they are all there.)

----------


## GolferGuy

the field Deficiency is defined as a Long Integer, but the data in the table is TEXT.  You need to go down each one of the fields in your table, and make the output specs match what is in the table.

----------


## Wog

I moved them all to text, and am still having the same issue.  Arg.

----------


## Allan Murphy

What is the result if you use DoCmd.TransferText acExportFixed, "", "Inspection_EXPORT", "c:/exp.txt", True, ""

----------


## ajdl99

Been reading this thread and it was interesting. Wog, did you already solve the problem? What codes did you use? I just want to look at them for reference. I'm trying to learn more by reading posts. 

Thanks.

----------


## dneelagiri

This message sometimes comes when there is an error in the Export specification.  I had mentioned a field name in the export specification which was not one of the columns being outputted by my query being exported.  I got the same error although the error message is completely meaningless for the problem.  Once I fixed the Export specification, the error went away.

----------

