Results 1 to 4 of 4

Thread: [RESOLVED] Option in ADODC or DataGrid components to update existing row?

  1. #1

    Thread Starter
    Addicted Member kutlesh's Avatar
    Join Date
    Jun 2018
    Location
    Skopje, Macedonia
    Posts
    202

    Resolved [RESOLVED] Option in ADODC or DataGrid components to update existing row?

    I am using ADODC component with select query to feed the DataGrid component with data.

    Everything works fine except, the thing I don't know how to update existing row instead of adding new one.
    There are two columns in the datagrid which serve as keys. When i add another row with the same combination of those two key columns, the datagrid saves another row in the table.
    Yes, the table should be set to have two keys, but its not, and i don't want to set keys, because its a legacy application and I might break other parts of it.

    Is there some option to tell either ADODC or DataGrid component to update existing row with that same combination of keys instead of adding a new row?

    Or I should add keys to my table, and explore where the application will break next?
    Last edited by kutlesh; Dec 5th, 2019 at 04:27 AM.

  2. #2

    Thread Starter
    Addicted Member kutlesh's Avatar
    Join Date
    Jun 2018
    Location
    Skopje, Macedonia
    Posts
    202

    Re: Option in ADODC or DataGrid components to update existing row?

    Tried adding keys to the tables. DataGrid shows error message of adding rows with duplicate keys, but the form need to be closed to be used again

  3. #3
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: Option in ADODC or DataGrid components to update existing row?

    You have to edit the existing row

  4. #4
    Frenzied Member
    Join Date
    Dec 2008
    Location
    Melbourne Australia
    Posts
    1,487

    Re: [RESOLVED] Option in ADODC or DataGrid components to update existing row?

    If you polled all of the experienced VB6 programmers, I reckon there would be very few using the Data Control.
    Your choice, but I would recommend learning to use pure ADO code instead.
    You will get better assistance if you do, because most of the experienced VB6 programmers are more familiar with the non Data Control approach.
    Rob

Tags for this Thread

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