Row cannot be located for updating access
, i have a datagrid which i fill with data using dtg Sample.datasource = my RS, my RS is a ado recordset object, but when i test the editing of the grid sometimes or most of the time it cause an error and displays "row cannot be located for updating. str SQL = "Select * from src_Branch where c Branch_Code = '" & Branch Code & "'"set My Rs = New Recordset My Rs. Open str SQL, Ado CN, ad Open Keyset, ad Lock Optimistic, ad Cmd Text Set frm Branch Branch.some values may have been changed since it was last read", any help!? Data Source = my RS'this is my SQL String and opening of recordset Hmmm...I'm sometimes surprised by their reaction to that question.The most common response is, "Why should I care what ADO is doing? In Xbase, it's easy to tell that the record you're accessing programmatically is the actual record in the actual table in the actual database file. The Jet engine keeps its own copy of the results of your query. Recordset Deyt = "As of " & Format(Date, "mmmm dd, yyyy") ! How can the row be not located when there is only ONE record in the table? Update End With In MS Access, the VB6 code above works very well.
Since an updatable client-side Recordset has a dynamic property named Update Criteria which defaults (ad Criteria Upd Cols) to using the original values of the modified fields as well as the values of the key fields in the WHERE clause of the query-based update, defaults can invalidate the action queries and generate the infamous 'specified row cannot be located' error.
Normally, record values are assigned to textboxes for edit then assign the values back to the fields for updating, is it possible that that causes the error?
thanks for the help, I really appreciate it." id="ctl00_m_m_i_ctl00_gr_ctl03_bestanswerbody" class="textarea-bestanswerhidden" name="bestanswerbody" answerbody Id="742834" / shuggi_e, yes, i used My SQLQuery Brower to retrieve the data and can even update it.
I just want my code to work." Unfortunately, I can't send customers to their rooms, and telling them I'm disappointed in them rarely generates much of a response. But when you modify a record in your Data Access Objects (DAO) Recordset (or your server-side ADO Recordset), the Jet engine physically locates and modifies the desired record.
The less you know about how ADO updates your database when you use a client-side cursor, the slimmer the chances that your application will work reliably. Update You can run this code and successfully add to the balance due for the customer with a Customer ID of 7. The ADO Cursor Engine doesn't work like Jet or like Xbase.
That statement usually gets a programmer's attention. Remember that the data in a client-side cursor is inherently disconnected from the database.