INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Jobs from Indeed

Access 2003 to 2007: Run-time error '3027' Cannot update, Database or object is read-only

Access 2003 to 2007: Run-time error '3027' Cannot update, Database or object is read-only

Access 2003 to 2007: Run-time error '3027' Cannot update, Database or object is read-only

(OP)
I have a database that worked fine in Access 2003. Now that I'm using Access 2007, it gives a run-time 3027 error. It is breaking down on the DoCmd.TransferText line. I've tried this on multiple computers (XP, Win7) and the file is being saved to the C: drive and I have administrative privileges. The MBNAExportSpecification export spec does exist in the MSysIMEXSpecs table. I also did the old jet registry hack to add the .prn extension to the list of exports (worked fine in 2003). Here is the code:

CODE -->

Private Sub Export_Click()

    Dim TempFileName As String
    
    Me.Form![txtFileName].SetFocus
    TempFileName = txtFileName.Text
    DoCmd.TransferText acExportFixed, "MBNAExportSpecification", "ExportTable", TempFileName
    Me.Form![txtFileName].SetFocus
    MsgBox ("Successfully exported the file " & txtFileName.Text)
    Me.Form![txtFileName].SetFocus
    
End Sub

Private Sub Form_Load()

    Dim DateToFilename As String
    DateToFilename = "C:\" & Format(Date, "mmddyyyy")
    Me.Form![txtFileName].SetFocus
    txtFileName.Text = DateToFilename & ".prn"
        
End Sub 

RE: Access 2003 to 2007: Run-time error '3027' Cannot update, Database or object is read-only

Try adding the destination folder to the list of trusted locations, and enable all macros in the Trust Center settings.

Beir bua agus beannacht!

RE: Access 2003 to 2007: Run-time error '3027' Cannot update, Database or object is read-only

(OP)
Done. Same error.

RE: Access 2003 to 2007: Run-time error '3027' Cannot update, Database or object is read-only

If by any chance you haven't done this on Vista/Win7, you may need to manually take ownership of the folders (even if you are logged in as admin): http://technet.microsoft.com/en-us/library/cc75365...

Beir bua agus beannacht!

RE: Access 2003 to 2007: Run-time error '3027' Cannot update, Database or object is read-only

(OP)
I just tried changing the .prn to .txt and get a new error.

Run-time error '3011':
The Microsoft Office Access database engine could not find the object '08142012#txt'. Make sure the object exists and that you spell its name and the path name correctly.

When I mouse-over the variable TempFileName its value is c:\08142012.txt.

RE: Access 2003 to 2007: Run-time error '3027' Cannot update, Database or object is read-only

(OP)
I tried on an XP machine w/ Access 2007, same error. This should rule out the permissions/ownership issue.

I also suspected a corrupt database so I restored it from a backup. It works fine as Access 2000 and I can convert to Access 2003 and open fine in Access 2003. When I convert or open it with Access 2007 I get the error.

RE: Access 2003 to 2007: Run-time error '3027' Cannot update, Database or object is read-only

banghead Maybe try converting the 2000 version directly to 2007?

Beir bua agus beannacht!

RE: Access 2003 to 2007: Run-time error '3027' Cannot update, Database or object is read-only

(OP)
bugeyed Good suggestion but same with or without conversion.

RE: Access 2003 to 2007: Run-time error '3027' Cannot update, Database or object is read-only

ARRRRRGH. I'll take another look tomorrow if you haven't found any relief.

Beir bua agus beannacht!

RE: Access 2003 to 2007: Run-time error '3027' Cannot update, Database or object is read-only

(OP)
I got this working but had to change the export to My Documents, rather than C:\. Also, the registry hack to allow saving as a .prn extension doesn't work so I had to export as fixed text to a .txt file and then used the Name command to rename the file to .prn

CODE -->

Private Sub Export_Click()

    Dim TempFileName As String
    Dim oldFileName As String
    Dim newFileName As String
    Dim strDocuments As String
        
    Me.Form![txtFileName].SetFocus
    TempFileName = txtFileName.Text
    DoCmd.TransferText acExportFixed, "Fixed Width 90", "ExportTable", TempFileName
    Me.Form![txtFileName].SetFocus
    MsgBox ("Successfully exported the file " & txtFileName.Text)
    Me.Form![txtFileName].SetFocus
    Export.Enabled = False
    
    Set WshShell = CreateObject("WScript.Shell")
    strDocuments = WshShell.SpecialFolders("MyDocuments")
    
    oldFileName = strDocuments & "\" & TempFileName
    newFileName = strDocuments & "\" & Left(TempFileName, 8) & ".prn"
    
    Name oldFileName As newFileName
    
End Sub

Private Sub Form_Load()

    Dim DateToFilename As String
    DateToFilename = Format(Date, "mmddyyyy")
    Me.Form![txtFileName].SetFocus
    txtFileName.Text = DateToFilename & ".txt"
    Command0.Enabled = True
    Export.Enabled = False
        
End Sub 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close