Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15549

VS 2017 Delete Record in Recordset by Row Number

$
0
0
Hello:

I would like to delete a row in a RecordSet using old school ADODB. Basically, I am deleting rows in a DataGridView, and after deleting various rows I do an update to preserve the order. The problem is, if there were more records to start with, the records at the end need to be deleted.

Code:

            If rs.RecordCount > ccnt Then
                For cx As Integer = ccnt To rs.RecordCount
                    ' Delete row cx
                    ' rs.Update()

                Next

            End If

Hopefully this is an easy question. I have done numerous web searches, including this: https://flylib.com/books/en/3.9.1.26/1/

Things are not obvious.

Thank you!

Viewing all articles
Browse latest Browse all 15549

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>