Results 1 to 2 of 2

Thread: Deleting a record from an ADO recordset

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2000
    Posts
    29
    Please help..

    I have used a datagrid to display records from an ADO recordset. What I need to be able to do is delete the currently selected record from the recordset.

    I have used the following code to determine the record the user has selected:

    DieSelected = datagridBookInDieNew.Columns("Order_ID").CellValue(datagridBookInDieNew.Bookmark)

    The selected record is then transferred into another table but I need to be able to delete it from the table it was in..

    Any help greatly appreciated

  2. #2
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    The ADO recordset object has a delete method, you just need to make sure that the recordset is pointing to the row you want to delete.

    recordset.Delete adAffectCurrent ' deletes current record
    recordset.Delete adAffectGroup 'deletes records that satisfy the current fiter property setting

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width