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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

database or object is read only when exporting query to text file.

Status
Not open for further replies.

Lana2002

Programmer
Apr 4, 2002
1
US
Hi!
I have a simple VB program that opens MS Access database and uses VBA to use DoCmd method.
There are 10 queries in the database and 10 export specifications for all of them.
When I run my program on my development machine everything goes smoothly, but on the production machine 8 out of 10 queries get transferred to text successfully and on 2 of them I get error message:
database or object is read only.
When I physically go into the database and export query to the file manually or run macro with the same peace of code as in my VB program everything goes fine.
Here is the code I'm using:


objAccess.DoCmd.TransferText acExportFixed, "My Spec1", "qMyQuery1", "C:\Temp\Data\myquery_data.txt", 0

Does anyone have any idea what's wrong with my program?
Any suggestions/ideas are highly appreciated!

THANKS!!!
 
Same problem. I'm using the build-in macro function to do it. Worked fine on development. I've tried to re-do it on production. Logged in as administration -- the whole shebang.
 
Lara --- I was exporting to "944.cd" Turns out if I export to "944.txt" then no problem. It was the extension in this case. I couldn't find that "cd" was associated with anything on this computer, but who knows.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top