PDA

Click to See Complete Forum and Search --> : How do i get rid of Read only access on a Database Table?


Spawny
Aug 3rd, 1999, 05:46 PM
Hi, I get a error '3027' when i run my program. It states in the error "Can't update. Database or object read only."
This is the code for CreateTransaction() function:

Dim mRstrans As Recordset, dd As Integer

Set qryDef = pDatabase.QueryDefs("QryResults")

Set mRstrans = qryDef.OpenRecordset(, dbOpenDynaset)
dd = Mid$(FrmMain.LsvDetails.SelectedItem.Key, 2)

Do While Not mRstrans.EOF
If mRstrans!RAccountID = dd Then
mRstrans.AddNew
mRstrans!RDate = FrmClient.TxtSize(0).Text
mRstrans!RComments = "Starting Weights and Scales"
mRstrans!RLThigh = FrmClient.TxtSize(1).Text
mRstrans!RRThigh = FrmClient.TxtSize(2).Text
mRstrans!RBust = FrmClient.TxtSize(3).Text
mRstrans!RWaist = FrmClient.TxtSize(4).Text
mRstrans!RHips = FrmClient.TxtSize(5).Text
mRstrans!RWeight = FrmClient.TxtSize(6).Text
mRstrans!RPlus = FrmClient.TxtSize(7).Text
mRstrans.Update
mRstrans.Close

mRstrans.MoveNext
Else
mRstrans.MoveNext
End If
Loop
mRstrans.Close

This code is on form 2 and i have called it on form1.. now it gets stuck on the line "mRstrans.addnew" and states that error but i have similar code on the frst form for a different table. QryResults combines the 2 tables together(clients and results). I have called on form 1 to open table clients but on form 2 i have only opened a query. Coukld this be the problem? Although i have tried to used table results here as well but same problem. Any ideas on how to unlock the table so it can be written to.

Thanks in advance
Mike

DMcManus
Aug 3rd, 1999, 07:28 PM
I had the same exact problem...my database wasn't that big and so I just re-made it because I couldn't find the problem. I tried to use the MS Knowledge Base...the closest I came was that if one of linked tables does't have a primary key then the recordset will come up read-only. I was pretty sure that was my problem (I had deleted a linked table and made it again and was pretty sure that messed up everything) but couldn't seem to find the link that had the problem. There were a couple of other explanations, I think if you use the Knowledge Base and type in "Can't update" then it gives you some ideas.

BShadow
Jun 7th, 2002, 07:53 AM
:( I still have the same problem...

I connect to a MySQL server and I get the readonly error, but when I do it trough a mdb file, everything is ok :(

When I use a MySQL GUI to access the same database I can edit everything...