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

184 views Asked by At

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

1

There are 1 answers

0
Tracer On BEST ANSWER

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
}