Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Microsoft office Access database engine could not find the object

I created a test MS Access DB to export a table to Excel and a text file.

This works for Excel:

DoCmd.OutputTo acOutputQuery, "QryExportToExcel", _
acFormatXLS, XFile, False

For the text file, I created a specification and used this code

DoCmd.TransferText acExportDelim, "Mytable Import Specification", "mytable", "D:\myfolder\test1.txt", False

In the error message, I get "test1#txt".

The Microsoft Office Access database engine could not find the object
"test1#txt". Make sure the object exists and that you spell its name
and the path name correctly.

Error which i got

I tried creating test1.txt in the same path. To my surprise, this deleted the file which is already present.

Software: MS ACCESS 2007

like image 721
shanmugamgsn Avatar asked Nov 04 '22 21:11

shanmugamgsn


2 Answers

The Microsoft Office Access databasse engine could not find the object "test1#txt". Make sure the object exists and that you spell its name and path name correctly.

This is a generic (and rather useless) error message that Access outputs in case anything goes wrong. One example would be a misspelled field name in the import/export specification.

You can get the "real" error message by trying the import operation "manually" in the Access user interface (rather than through code).

like image 84
Heinzi Avatar answered Nov 15 '22 07:11

Heinzi


The question author reported the problem was "because I was using an Import Specification for Exporting a file."

They resolved the problem by using an Export Specification.

like image 39
2 revs Avatar answered Nov 15 '22 06:11

2 revs