Error 3027 using TransferText Method

S

Sally Green

I'm using Access 2003, file format though is 2000.
In a Userform I'm using Docmd.TransferText to transfer a table (with one
field only, Memo data type), using a Data Spec file that I've set up and
saved, to a file name abc.txt.

I get error 3027 Cannot Update. Database or object is read-only.

the database is definitely not read-only. It's on a stand-alone PC.

If I go through this process manually using File / Export etc it works fine.

I'm sure the line of code is OK as I've used something similar before but
here it is:

DoCmd.TransferText acExportDelim, "PC Banking",
"tblPCBankingExport", "C:\abc.txt", False

Where: PC Banking is the name of the spec file, tblPCBankingExport is the
name of the table within the database, and C:\abc.txt is the name for the new
file.

I've tried acExportDelim and acExportFixed. I've also tried with the only
field in the table being a Text datatype instead of memo.

Any suggestions?
 
O

OfficeDev18 via AccessMonster.com

Sally,

You're putting the cart before the horse, I'm afraid. Instead of

DoCmd.TransferText acExportDelim, "PC Banking", "tblPCBankingExport", "C:\abc.
txt", False

try

DoCmd.TransferText acExportDelim, "tblPCBankingExport", "PC Banking", "C:\abc.
txt", False

According to the Help file, the specification name comes first, not the table
name.

Sam
 
S

Sally Green

The spec name is "PC Banking" and the table name is "tblPCBankingExport". I
had put the spec name first.

I have a fix now, it was very quirky. I had to create the text file first
so that the name already existed in the receiving folder (C:\xxx\etc). Then
when I ran the code it just replaced the file. once I had run it once, I
could then delete the file and run it as originally setup without error.
Weird or what?
 
O

OfficeDev18 via AccessMonster.com

Sally,

It does sound weird. However, I must have had my glasses on backwards. Thanks
for setting me straight.

Sam

Sally said:
The spec name is "PC Banking" and the table name is "tblPCBankingExport". I
had put the spec name first.

I have a fix now, it was very quirky. I had to create the text file first
so that the name already existed in the receiving folder (C:\xxx\etc). Then
when I ran the code it just replaced the file. once I had run it once, I
could then delete the file and run it as originally setup without error.
Weird or what?
[quoted text clipped - 38 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top