CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2010
    Posts
    17

    datagride & MS access ..Delet Row

    hi all ,

    i have daragride view connect to Access data base, my question is that, how i can delete a specific row when i click on it from datagride and database ????
    this is a data grid ...



    when i click in the spacific row i will get msg box of the clicked row ....

    from this code

    Code:
    Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
    msgbox DataGrid1.Row  ' the row number 
    
    msgbox DataGrid1.Columns(3).Text
    
    End Sub

    please help me out to delete a record when i click a specific row ??????



    also how i can reuse a ID number in the database ??????

    best regards

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: datagride & MS access ..Delet Row

    Download the code from the article, and take a look. Bound Controls are EVIL, in VB6.

    As far as reusing a KEY, that's just plain BAD DESIGN. Keys are supposed to be unique. If you want to use something again, come up with another field along with the KEY
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Dec 2001
    Posts
    6,332

    Re: datagride & MS access ..Delet Row

    If by reusing an ID number, you mean being able to store a record with a previously used ID, which was deleted, AFAIK you can't if it is an Auto-Increment field. It would create problems if the ID refers to data in other tables anyway.

    Is there some reason why you'd need or want the ID to never skip a value?
    Please remember to rate the posts and threads that you find useful.
    How can something be both new and improved at the same time?

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

Featured