I've hit this Database or object is read only error.
That's because our company is using a centre workgroup information which means everybody shares the same system.mdw.
It's this situation similar to yours?? When ever you open a database by codes, it uses the default admin user. If the permission for the admin user it not set to administer and modify, it will come out this error. Hope this help.