0

Good day g'Men!

I just needs some advise or code about positioning the recorset after requery!
I have 20 records in a table, I am on record no 10 and deleted it and pull movenext. The record to be view is record no 11. but a get the last record which is record no 20..

Here is the code so far:

dim rsbookmark as long
dim rsdelete as new Adodb.Recordset
dim objcommand as new objcommand.Command
objcommand.ActiveConnection-strconnection 'my cnn string
objcommand.CommandText="delete from tbl_pos_summary where record_no=10"
objcommand.CommandTimeout=600
set rsdelete=objcommand.Execute
rsdelete.requery
rsdelete.movenext

'data no 11 must be displayed but it displays the last record. I know Ado bookmark property would make this correct but I cant get it working.

Need your help guys.

Thank you!

Edited by blocker

3
Contributors
3
Replies
4
Views
4 Years
Discussion Span
Last Post by blocker
Featured Replies
  • thank you AndreRet, QVeen72. both works for me..The trick is that bookmark or absoluteposition must be initiated before the requery. Thank you! Read More

0
Dim x as Integer

x = "10"

dim rsbookmark as long
dim rsdelete as new Adodb.Recordset
dim objcommand as new objcommand.Command
objcommand.ActiveConnection-strconnection 'my cnn string
objcommand.CommandText="delete from tbl_pos_summary where record_no='" & x & "'"
objcommand.CommandTimeout=600
set rsdelete=objcommand.Execute

x = x + 1
rsdelete.Bookmark = x

This should do the trick...

0

Hi,

Something like this :

dim i as long
i = rs.AbsolutePosition
rs.Delete
rs.ReQuery
If Not rs.EOF Then
    rs.MoveFirst
    rs.Move i
End If

Regards
Veena

1

thank you AndreRet, QVeen72. both works for me..The trick is that bookmark or absoluteposition must be initiated before the requery.

Thank you!

Edited by blocker

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.