Page 1 of 1

problem with Locate

Posted: Wed 16 May 2007 12:12
by soaphead
getting a compiler error:
Could not find a match for 'TMemDataSet::Locate(AnsiString,Variant,TLocateOption)'

void __fastcall TForm1::Edit1Change(TObject *Sender)
{
AnsiString empl = "jeempl";
MSTable1->Locate(empl,(Variant)Edit1->Text,loPartialKey);
}

Locate function does not like anything I put into it..
Thanks,
Mike

Posted: Wed 16 May 2007 13:08
by Jackson
You should use the following construction:

Code: Select all

        AnsiString empl = "jeempl";
 
        TLocateOptions Opts;
        Opts.Clear();
        Opts Locate(empl,(Variant)Edit1->Text, Opts);