Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

3027 read only error 1

Status
Not open for further replies.

robojeff

Technical User
Dec 5, 2008
220
US
I get a 3027 error database is read only error on the following code.

What am I doing wrong?

Thanks

-------------------------
Dim qdf As DAO.QueryDef
Dim dbs As DAO.Database
Dim rstProduct As DAO.Recordset

Set rstProduct = dbs.OpenRecordset(strSQL, dbOpenDynaset)

With rstProduct
.Edit
!ASMFlag = "1"
.Update
End With
-------------------
 
Oopps...
I forgot to add the following line:

strSQL = "SELECT DISTINCT Stage1_tbl.ASMFlag FROM Stage1_tbl; "

It appears that the error for the read only may apply to my table Stage1_tbl but I am not sure why...

-------------------------
Dim qdf As DAO.QueryDef
Dim dbs As DAO.Database
Dim rstProduct As DAO.Recordset

strSQL = "SELECT DISTINCT Stage1_tbl.ASMFlag FROM Stage1_tbl; "

Set rstProduct = dbs.OpenRecordset(strSQL, dbOpenDynaset)

With rstProduct
.Edit
!ASMFlag = "1"
.Update
End With
 
Remove the DISTINCT predicate.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
How are ya robojeff . . .

In windows explorer have a look at the properties of the db file. Make sure its not read only here!

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Thanks PHV-

Removing the Distinct did the trick.

Is there an easy way to also modify the ASMFlag in another table at the same time?

Dim qdf As DAO.QueryDef
Dim dbs As DAO.Database
Dim rstProduct As DAO.Recordset

strSQL = "SELECT DISTINCT Stage1_tbl.ASMFlag FROM Stage1_tbl; "

Set rstProduct = dbs.OpenRecordset(strSQL, dbOpenDynaset)

With rstProduct
.Edit
!ASMFlag = "1"
.Update
End With

I am assuming that I would need to do a look up on the other table for all records containing the same Item as I am indexing in my rstProduct recordset above, but I am not sure how to do this...

Thanks

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top