Vb 6 0 row cannot be located for updating

Anybody got a clue what's wrong here, or have another suggestion of how I could select multiple records based upon a list of doc numbers, then delete all records with the appropriate doc number?

Requery Loop End With Problem is, this requires a write and then reopen of the table every time and is horribly slow for a large number of records.

vb 6 0 row cannot be located for updating-12

Some values may have been changed since it was last read."This is a lot like the behavior described in MS bulletin Q300586, except that it doesn't seem to matter whether there's a default value in a numeric index field or not. Alternatively, if I could cycle thru my delete list and simply say "DELETE FROM [data table] WHERE Document = Doc" where Doc is a string variable read from my delete list, this would also be great. Refresh Loop End With The reason why you are getting the error is because on the last record which isn't end of file, you are deleting it, then trying to move to the next record which can't be done because it is now end of file. I get this error after delete of *every* line in the list, not just the last one.

Refresh Loop End With At the point of "Move Next," VB crashes with the error: "Run-time error '-2147217864 (80040e38): Row cannot be located for updating. Ideally, I'd love to execute a single statement which says "DELETE FROM [my data table] WHERE Document IN [a datagrid of doc numbers I already queried]" but I can't find enough documentation to tell me how to do this. EOF I'm gonna try Matt's suggestion in a minute, but bdavis96's suggestion is not correct.

95% of the code you'll find on this page was written by me, the other samples were either edited or submitted.

This guide does not claim to have the best answers, just answers that will get the job done. If you aren't able to find what you need here, you can check out the main programming section for additional VB 6.0 code and tutorials.

Trying to do an efficient delete of multiple records in an ADO recordset bound to a Data Grid control, and populated from an MS Access 2000 database. This will open and set everything'Dim con Obj As New ADODB. Data Source = rs Objdatagrid.refresh'''''''''''''''''''''''' 2. I'd like to sort on two other fields, Date Time and Document, which taken together form unique records, and then renumber the Index field.2) Then I'd like to do the equivalent of Access' "Compact and repair database" tool. Again thanks, Dan Well, for the compacting you can use JRO (Microsoft Jet And Replication Objects). So what I want to do is simply renumber the records after deleting the old ones. Trying to do the same thing with the data-bound control produces the same error on update that deleting a record did.

A row is deleted using the following code: With db Main. Here's what I've tried:'Reindex [Log] Dim dbcount As Integer con Obj1. Open str Query1, con Obj1, ad Open Static, ad Lock Read Only dbcount = rs Obj1. How do I sequentially write the numbers to the fields?This is a collection of highly requested Visual Basic code that I put together back in 19.Almost all of these samples will work on fine on Visual Basic 5.0 and for Microsoft Excel and Microsoft Access Programming (when done with VBA), however, I've only made sure that they work in VB6. This will solve the problem of having to refresh on every delete, you will only have to do it after every user request. Thanks Dan My suggestion would be to dump the data control and bind the grid manually to a recordset. This way you can grab the list of records you wish to delete from the grid, place those indexes (or whatever you decide) in a Delete statement and then requery and refresh the grid after you are done.To make something happen when you click on an item you have to subclass the menu (I'd help with that but I don't have any subclassing controls, or at least not right now).

Tags: , ,