Problem Using TransferText

  • Thread starter Thread starter Sue
  • Start date Start date
S

Sue

Using WindowsXP and AccessXP in 2000 Mode

When I run the following code, I get error 3027
"Cannot Update. Database or object is read only."

StrFolder = "C:\Comic Box\WebStore Interface Database\UpLoadChangeFiles\"
StrFile = "NewStoreItem" & Format(Now(), "yymmddhhnn") & ".txt"
DoCmd.TransferText acExportDelim, "NewStoreItem Export Specification",
"QryPFrmAddNewItemToWebstore", StrFolder & StrFile, False

However, when I go to File Export and export QryPFrmAddNewItemToWebstore to
C:\Comic Box\WebStore Interface
Database\UpLoadChangeFiles\NewStoreItem030922051720.txt, I don't encounter any
problem and the text file is created in the path.

Does anyone have an idea why manually it works and transfertext does not?

Thanks for all help!!

Sue
 
The message usually indicates that Access can't create the file. Sometimes
this is because you are using a non-registered file extension, but you
example seems to indicate ".txt". You may want to check that .txt has not
been reassigned in the Windows registry.

Look for other reasons the file creation may fail. For example, in a loop,
the file may already exist. Or the specification may no longer match the
actual fields of the table or their data types.
 
Also, sometimes the process fails because the path + filename is too long.
I've also had it fail a few times when there are spaces in the path and/or
filename.
 
Sue said:
Using WindowsXP and AccessXP in 2000 Mode

When I run the following code, I get error 3027
"Cannot Update. Database or object is read only."

StrFolder = "C:\Comic Box\WebStore Interface Database\UpLoadChangeFiles\"
StrFile = "NewStoreItem" & Format(Now(), "yymmddhhnn") & ".txt"
DoCmd.TransferText acExportDelim, "NewStoreItem Export Specification",
"QryPFrmAddNewItemToWebstore", StrFolder & StrFile, False

However, when I go to File Export and export QryPFrmAddNewItemToWebstore to
C:\Comic Box\WebStore Interface
Database\UpLoadChangeFiles\NewStoreItem030922051720.txt, I don't encounter any
problem and the text file is created in the path.

Does anyone have an idea why manually it works and transfertext does not?

Not yet, but when you manually export, are you using the export
specification "NewStoreItem Export Specification" that you were
attempting to use with TransferText?

Bruce
 
Back
Top