Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export file name problem 1

Status
Not open for further replies.

meldrape

Programmer
May 12, 2001
516
US
Greetings, I have a simple query I need to export as "qte.mat" and I am getting a database or object read only error. When I change the name to "qte.txt" it exports perfectly. Anybody know how I can handle this? it HAS to have the "mat" extension. here's my code:

Code:
txtFile="\\servername\qte.mat"
DoCmd.TransferText acExportDelim, "exportspec" , "tblExportEstimate", txtFile, False

Like I said, if I use the "txt" extension it exports fine. Going crazy here. Anybody have any ideas how to handle this with code? Thanks in advance.
 
Hi
I am getting the same problem. Would exporting as text then renaming suit?
Code:
OldName = "qte.txt": NewName = "qte.mat"    ' Define file names.
Name OldName As NewName    ' Rename file.

 
Wow, that totally worked. Many many thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top