CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2011
    Location
    Greece
    Posts
    26

    Update a record with ADODataset

    Goodmorning
    I am using a database in access 2007 and c++ builder 2007. I have a problem and i want some help. I have a dbgrid on my simple application and the user find a record and click on it. When he clicks all the data return to Edit text. Now i want the user to make some changes on edit text (on data) and update the record. I have wrote the above code

    [CODE]

    Form7->ADODataSet2->Active=true;
    Form7->ADODataSet2->Edit();

    ADODataSet2->FieldValues["AR_PAROXHSD"]= Edit2->Text ;
    ADODataSet2->FieldValues["CUSTOMER_NAMED"]=Edit4->Text;
    ADODataSet2->FieldValues["CUSTOMER_SURNAMED"]=Edit5->Text;
    ADODataSet2->FieldValues["CUSTOMER_FATHERD"]=Edit6->Text;
    ADODataSet2->FieldValues["CUSTOMER_STATHEROD"]=Edit7->Text;
    ADODataSet2->FieldValues["CUSTOMER_MOBILED"]=Edit8->Text;
    ADODataSet2->FieldValues["CUSTOMER_AAKAT"]=Edit9->Text;
    ADODataSet2->FieldValues["CUSTOMER_ADDRESSD"]=Edit10->Text;
    ADODataSet2->FieldValues["CUSTOMER_CITYD"]=Edit11->Text;
    ADODataSet2->FieldValues["CUSTOMER_ZIPD"]=Edit12->Text;

    ADODataSet2->Post();
    [CODE]
    The problem is that when i push the update button it changes my first row of databse and not the one that user select. I need to add something on code so to move in record that the user choose and then edit and post

  2. #2
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,620

    Re: Update a record with ADODataset

    You'd better ask this in some Borland forums. As BC++/Delphi adodataset implementation is very Borland specific, and your question has nothing to do neither with C++ nor WinAPI.
    Best regards,
    Igor

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