c++c++builderc++builder-xe

collecting data fromcollect data in the "ADOTable" into txt access


I create applications with C ++ Builder XE and ms access 2010.

by: ADOConnection > ADOTable > DataSource > DBGrid.

how to collect the data that appear in the DBGrid. I know use this code:

AnsiString tmpText;
tmpText+=ADOTable2->FieldByName("Name")->AsString;

but could not take all of the data that is in DBGrid


Solution

  • For example:

    ADOTable1->First(); // go to first record
    for(int i = 0; i < ADOTable1->RecordCount; i++){
        // read all columns needed by using ADOTable1->FieldByName("FieldName")->As..
        ADOTable1->Next(); // go to next record
    }