Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2004
    Posts
    45

    Unanswered: Run-time Error '3027': Can't update. Database or object is read-only

    hallo,
    I'm trying to edit a recordset (msa 2000) but I get an error of read only database. The code I use is this:

    Set rs_act = dBase.OpenRecordset(StrSELECT_act & StrFROM1_act & StrFROM2_act & StrWHERE_act)

    rs_exp_org.MoveFirst
    rs_act.MoveFirst
    Do Until rs_act.EOF
    rs_exp_org.MoveFirst
    Do Until rs_exp_org.EOF
    If rs_act!Tra_OrganizationID = rs_exp_org!Org_ID And rs_act!tra_exported = 0 Then
    rs_exp_act.AddNew
    rs_exp_act!Tra_id = rs_act!Tra_id
    rs_exp_act!Tra_OrganizationID = rs_exp_org!Org_ID
    rs_exp_act.Update
    ' here is where the error happens
    rs_act.Edit
    rs_act.Fields(12).Value = -1
    rs_act.Update
    rs_exp_org.MoveNext
    Else
    rs_exp_org.MoveNext
    End If
    Loop
    rs_act.MoveNext
    Loop

    Is there something wrong I don't see? Thanks for helping

  2. #2
    Join Date
    Jul 2004
    Posts
    125
    You can't .Addnew in one table and .Edit the the linked record at the same time. How can a related record exist in the 2nd table when you're adding the record to be related. Use 2 record sets.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •