Why I can't export a text file, what's wrong here????

  • Thread starter Thread starter Marco
  • Start date Start date
M

Marco

Hello.

I'm trying to export export a query result into a text file (not using a
link to a text file) and it's returning me an error message saying that it
cannot find the object.

I have this:
DoCmd.TransferText acExportDelim, "SupplierOrderHeader", "21",
("C:\Teste.txt")

And it returns me this error:
"The Microsoft Jet database engine could find the object 'Teste.txt'. Make
sure tha object exists and that you spell its name and path name correctly."

It's strange because I already did this in another batabase and it's working
pretty well.

I also tried to link access to a text file and then using a Append query to
insert que results into that text file but is not working.

But the most strange thing is that if I run the query as a select query it
show me everything ok.

I need this:
2402006|2006-04-17||N|||

and is happening me this:
2412006|2006-02452006|2006-04-17||N|||


Can somebody help me??

Regards,
Marco
 
Then I'd say your file C:\Teste.txt does not exist. Check the path and name
of the file.
 
I wouldn't think that the file needs to preexist in order to be able to
export to it.

More likely is that Marco doesn't have permission to write to the root of
C:\
 
Douglas J. Steele said:
I wouldn't think that the file needs to preexist in order to be able to
export to it.

Ah yes.... I was mistakenly writing an answer for an import... musta been a
different post that was stuck in my memory :-)
More likely is that Marco doesn't have permission to write to the root of
C:\

I concur.
 
Hello.

Actually I'm the administrator, I have full access to the drive.

I did another exportation with a diferent query and text file and it worked
perfectly.

Strange. But I solved the problem by exporting the table to a text file
saving the definitions and then I used those definitions to export the file
automatically.

Thanks.
Marco
 
Back
Top