PDA

View Full Version : Solved: Read Only?



FrymanTCU
05-06-2008, 10:41 AM
I am trying to export an excpection table after I run a series of queries to clean up a file. But somehow I keep getting an error stating the object is read only, Run time error '3027'. I do not know where I set the file to read only and how to reverse it. I have included a small part of the code that runs but I don't ever set database to read only or use the script open database. Please help!

DoCmd.OpenQuery "NewExceptionOutputFile", acViewNormal, acEdit
DoCmd.SetWarnings True
DoEvents
DoCmd.OpenTable "CurrentExceptions", acViewNormal, acEdit
'DoCmd.TransferSpreadsheet acExport, 8, "CurrentExceptions", "C:\Documents and Settings\richard.frye\Desktop\Manual Doc Audit\DocStatAudit.xml", True, ""
'DoCmd.TransferSpreadsheet acExport, 8, "CurrentExceptions", "C:\Documents and Settings\richard.frye\Desktop\Manual Doc Audit\DocStatAudit_" & Format(Now(), "m.d.yy") & ".xml", True, ""
DoCmd.Close acForm, "MainMenu"

CreganTur
05-06-2008, 11:16 AM
If I remember correctly the problem is caused by the .xml at the end of your filepath. You actually don't need to to put the file extension at the end of your filepath.

Also you don't need to put the empty string ("") after your ,True

Try this:
DoCmd.TransferSpreadsheet acExport, 8, "CurrentExceptions", _
"C:\Documents and Settings\richard.frye\Desktop\Manual Doc Audit\DocStatAudit", True
DoCmd.TransferSpreadsheet acExport, 8, "CurrentExceptions", _
"C:\Documents and Settings\richard.frye\Desktop\Manual Doc Audit\DocStatAudit_" & Format(Now(), "m.d.yy"), True

FrymanTCU
05-06-2008, 12:28 PM
CreganTur you rock, I love this forum. Who would ever guess an accountin / economics major could be doing computer programing! Thanks for all your help.
-Rich

CreganTur
05-06-2008, 01:03 PM
Who would ever guess an accountin / economics major could be doing computer programing! Thanks for all your help.
-Rich

Heh... I majored in technical theatre in college- building/designing sets, lighting, sound, etc.

Now I work for a large financial institution doing projects and programming. This(programming) is one of the few fields you can do really well in without having to go to school for it. Just study a lot and test out all the new stuff you can get your hands on and you'll be good.

Oh, and a good reference book couldn't hurt either:*)