Runtime error 3027 Cannot update Database or Object is Read only

Hemish

Registered User.
Local time
Today, 09:30
Joined
Jan 20, 2005
Messages
65
Hi

I'm having trouble with my database (Access 2000). I'm trying to export a file into a text file by clicking on a button. Below is the code. Where the code is in bold that is when the runtime error happens.

If i export the code manually by right click on the query > Export then this works, but for some reason by clicking on the button will not work.

Private Sub cmdExport_Click()
Dim sExportFilePath As String
sExportFilePath = DLookup("[DateExportLocation]", "tblSettings", "[ID]=1") ' Path if file to be exported
DoCmd.OpenQuery "qryUpDateTransmissionDateAndTime", acViewNormal, acEdit ' Update dates time
DoCmd.TransferText acExportDelim, "ExportFile", "qryExportFile", sExportFilePath
End Sub


I appreciate your help
 
I'm not sure that this is going to be the issue, but check that the field in your look up statement ........ DateExportLocation........... includes the full path and file extention. e.g. C:\MyDirectory\MyFolder\MyFileName.txt

just a thought. Hope it helps. Or at least points you in the right direction.

Cheers,
 
Whoa! You responded to a question posted in September of 2005? Hopefully, they have it figured out by now. ;)
 
Whoa? I have the same issue on Win 8 .. The thing is hundreds of people might have had or will have the issue, they google search it but are too lazy to create an account and ask again.. so you must understand that the second poster did not answer the first poster but the future posters like myself.
 
Wow. Away, foul necromancer!
 

Attachments

  • Necro.jpg
    Necro.jpg
    50.4 KB · Views: 291

Users who are viewing this thread

Back
Top Bottom