hello

I've been designing a bookStore, tought it's not an easy task. It has been sweating me for no reason,errors pop up in correct statement.

An error pops up saying compliation error: member or method not found in line

adodc.RecordSet.Edit


here is the full code:

Private Sub Command3_Click()
    Dim Deposit As Single
    Dim currentDate As Date
    
    Deposit = Text3.Text
    currentDate = DateValue(Today)
    
    dataDeposit.Recordset.Edit <=== here
    dataDeposit.Recordset.Fields("depositAmount").Value = Deposit
    dataDeposit.Recordset.Fields("depositID").Value = ID
    dataDeposit.Recordset.Fields("studentID").Value = ID
    dataDeposit.Recordset.Fields("date").Value = currentDate
    dataDeposit.Recordset.Update
    dataDeposit.Recordset.MoveNext
End Sub

Do you see anything out of normal?

Dani AI

Generated

As and observed, the compilation error comes from calling a method that ADO recordsets do not expose. With ADO you do not call an Edit method; you change the Recordset.Fields values (or use AddNew for inserts) and then call Update. Removing the invalid Edit call will clear the compile error.

If updating still fails at runtime, check these common causes:

  • The Recordset is positioned at EOF/BOF (nothing to edit). Make sure you are on a valid row.
  • The SQL/record source is not updateable (joins, DISTINCT, GROUP BY, aggregates, or complex views often produce read-only results).
  • The provider/cursor/lock settings prevent updates. Use a cursor type and lock type that support updates (keyset/dynamic and optimistic locks are typical) and try client-side cursoring if necessary.
  • Missing primary key on the underlying table or insufficient database permissions.

A few practical tips that often fix subtle problems:

  • Validate and convert user input before assigning to fields (IsNumeric/IsDate, then CSng/CInt/CDate or Val) to avoid data-type errors.
  • Use VB6 built-ins (Date or Now) to get the current date rather than nonstandard names.
  • Inspect the Recordset at runtime (rs.BOF/rs.EOF, rs.LockType, rs.CursorType, rs.Supports(adUpdate)) to confirm update capability.
  • If you get an error on Update, capture Err.Number and Err.Description; they point to permission/SQL/constraint issues.

If uncertainty remains, reproduce the problem with a minimal test: open the same table directly (no joins), try a single field change, and observe whether Update succeeds. That isolates whether the problem is your code, the query, or the database/provider settings.

Recommended Answers

All 2 Replies

Yes, that is one of the things implemented with ADO and the ADODC. You do not need to call the edit method like you need to with DAO or the DATA control as it does not exist. Just remove it, the edit line that causes the error, and everything should work fine.

Good Luck

just remove this line

dataDeposit.Recordset.Edit
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.