problem with Locate

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
soaphead
Posts: 1
Joined: Wed 16 May 2007 11:55

problem with Locate

Post by soaphead » Wed 16 May 2007 12:12

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

Jackson
Posts: 512
Joined: Thu 26 Jan 2006 10:06

Post by Jackson » Wed 16 May 2007 13:08

You should use the following construction:

Code: Select all

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

Post Reply