Group:  Microsoft Access ยป microsoft.public.access.modulesdaovba.ado
Thread: Error 3027 using TransferText Method

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Error 3027 using TransferText Method
Sally Green 11.07.2006 05:42:02
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?



Re: Error 3027 using TransferText Method
"OfficeDev18 via AccessMonster.com" <u14095[ at ]uwe> 11.07.2006 14:13:07
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

Sally Green wrote:
[Quoted Text]
>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?

--
Sam

Message posted via http://www.accessmonster.com
Re: Error 3027 using TransferText Method
Sally Green 17.07.2006 05:10:02
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?

"OfficeDev18 via AccessMonster.com" wrote:

[Quoted Text]
> 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
>
> Sally Green wrote:
> >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?
>
> --
> Sam
>
> Message posted via http://www.accessmonster.com
>
Re: Error 3027 using TransferText Method
"OfficeDev18 via AccessMonster.com" <u14095[ at ]uwe> 17.07.2006 15:07:16
Sally,

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

Sam

Sally Green wrote:
[Quoted Text]
>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?
>
>> Sally,
>>
>[quoted text clipped - 38 lines]
>> >
>> >Any suggestions?

--
Sam

Message posted via http://www.accessmonster.com

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net