Cannot update. Database or object may be read-only

ailinglew

New member
Local time
Today, 15:51
Joined
Dec 6, 2009
Messages
6
Hi All,

I have recently converted a database from Access 97 to Access 2007 which used the TransferText command.

DoCmd.TransferText acExportDelim, "Testing Export Specification", "Testing", "C:\Testing" & "." & Format(Now(), "yymmddhh") & "08"
- which worked fine.


However, when I try to run this line of code in Access 2007 I get a message "Cannot update. Database or object may be read-only".

Anybody know how to make this work?

Thank you.

 
Thanks for your reply.

Yes, in Trusted Location.
I would like to check with you, is that possible to generate output file as Testing.yymmddhh08 (eg: Testing.0912080108) in Access 2007?
Actually the same coding use for Access 97 and it is working fine. The error happened after converted into Access 2007.
May i know is that Access 2007 does not support for this file type?

Thank you.
 
What about the file extension? I think you're missing the extension (.txt or .csv, .xls, etc).
 
Hi boblarson,

This is the output file "Testing.0912080108" that the Access application need to be generated.
We are using Access 97 to generate output file with this file type ".yymmddhh08" for a few years. Recently my company want to upgrade to Access 2007 and i found the error after converted to Access 2007.
May i know is that Access 2007 does not support for this file type?

Thank you.
 
Hi All,

Could anyone tell me that Access 2007 able to create this kind of file (eg:Testing.0912080108)? If it is cannot, then i need to think other solution.

Thank you.
 
Can't you just create a Foo() function in a standard module that create a test file to see if Access will do it? Then call it from the immediate window.
 
I've tried to create a simple module to generate output file (eg: Testing.1234) from a table. I get an error and highlighted on statement below when debugging.

DoCmd.TransferText acExportDelim, "", "Testing", "C:\Testing.1234"

Error:
Run-time error '3027':
Cannot update. Database or object is read-only.
 
Last edited:
I've done enough testing to know that error is not being caused by the output filename. Access does not like something else in the syntax.
 
One thing - do NOT use "" for the export spec name. If you have an export spec, great. If not, do not put anything there:

DoCmd.TransferText acExportDelim, , "Testing", "C:\Testing.1234"
 
That's the first thing I did Bob and still have the same error.
 
I've done enough testing to know that error is not being caused by the output filename. Access does not like something else in the syntax.

Well, if I change the file name to .txt instead of .1234 it works. So, it would seem that it doesn't like that extension.
 
However, THIS does work:

Code:
DoCmd.TransferText acExportDelim, , "Testing", "C:\Testing.txt"
Name "C:\Testing.txt" As "C:\Testing.1234"
 
Darn, I tried .123 instead of .1234 but didn't try .txt. Good catch Bob.
 
I just tried it with Testing.12345678 without any problem. I believe that is the OP's solution.
 
Hi RuralGuy,

Could i have your code to generate Testing.12345678 without any error?
Thank you.
 
It is just Bob's code with more characters in the extent of the filename.
Code:
DoCmd.TransferText acExportDelim, , "Testing", "C:\Testing.txt"
Name "C:\Testing.txt" As "C:\Testing.12345678"
 

Users who are viewing this thread

Back
Top Bottom