Главная страница | назад





Article #16853: How to use Locate on TDataSet with multi fields

 Question and Answer Database
FAQ1853C.txt How to use Locate on TDataSet with multi fields
Category :VCL
Platform :All
Product :C++Builder 1.x
Question:
How to use Locate with more than one field on a TDataSet
derived control?
Answer:
When using locate with more than one field on a TDataSet
dervided contol, you need to use a Variant object for the search
criteria param. This is done with the following code:
void TForm1::LocateBtnClick(TObject* Sender)
{
TLocateOptions flags;
Variant keys[] = { "Value1", "Value2"};
Table1->Locate("Field1;Field2", Variant(keys, LASTIDX(keys)), flags);
}
7/2/98 10:32:32 AM

Last Modified: 01-SEP-99