OK, I misunderstood what you are doing. You are still going to use the
DataSet to get each cell's individual data. The active row in the DBGrid will also be the active row in the DataSet. There are several ways to get this info. You can use
ARRAYOFCONST,
FieldValues, or
FieldByName for example. Which you use is defined by preference, what you know about the data base (field name or location), or the database itself.
I personally prefer
FieldByName since I know each field's name in a table. For example, suppose my table has three fields,
Item, a string;
ItemCount, an integer; and
ItemCost, a floating point value.
Now suppose I click on an item on the DBGrid. I could obtain each field's (cell's) info like this:
Code:
AnsiString ItemStr = DataSet->FieldByName("Item")->AsString;
int ItemCountInt = DataSet->FieldByName("ItemCount")->AsInteger;
double ItemBucks = DataSet->FieldByName("ItemCost")->AsFloat;
Read and understand about
DataSets. They will the the basis for all other data base components.
James P. Cottingham
-----------------------------------------
I'm number 1,229!
I'm number 1,229!