Board index » delphi » D2 to D3 app convert problem - Locate Options

D2 to D3 app convert problem - Locate Options

The following statement in a DBGrid KeyPress event and it worked fine in
D2, but won't compile in D3:

DBGrid.DataSource.DataSet.Locate('Name', SearchKey, [loCaseInsensitive,
loPartialKey]);

The compiler generates:
        Undeclared Identifier: 'loCaseInsensitive'.
        Undeclared Identifier: 'loPartialKey'.

I'm stumped...

Jeff Hamblin
jhamb...@REMOVE.n2.net
===
To email me, take the REMOVE out of my email address

 

Re:D2 to D3 app convert problem - Locate Options


Add:

  var
   searchOptions: LocateOptions;

and...

   searchOptions := [loCaseInsensitive,loPartialKey];

then...

   DBGrid.DataSource.DataSet.Locate('Name', SearchKey, searchOptions);

Quote
Jeff Hamblin wrote:

> The following statement in a DBGrid KeyPress event and it worked fine in
> D2, but won't compile in D3:

> DBGrid.DataSource.DataSet.Locate('Name', SearchKey, [loCaseInsensitive,
> loPartialKey]);

> The compiler generates:
>         Undeclared Identifier: 'loCaseInsensitive'.
>         Undeclared Identifier: 'loPartialKey'.

> I'm stumped...

> Jeff Hamblin
> jhamb...@REMOVE.n2.net
> ===
> To email me, take the REMOVE out of my email address

--
+--------------------------------------------------------------------+
| Juan E. Jimenez, San Juan, Puerto Rico, jjime...@caribe.net        |
| Building Bede Aircraft BD-5B Pocket Rocket, Serial #2544           |
| Visit Juan's BD-5 Home Page at http://netdial.caribe.net/~jjimenez |
+--------------------------------------------------------------------+

Re:D2 to D3 app convert problem - Locate Options


The answer to this problem is that the DB unit had to be added to the uses
clause...
--
Jeff Hamblin
jhamb...@REMOVE.n2.net
===
To email me, take the REMOVE out of my email address

Quote
> Jeff Hamblin wrote:
> The following statement in a DBGrid KeyPress event and it worked fine in
> D2, but won't compile in D3:

> DBGrid.DataSource.DataSet.Locate('Name', SearchKey, [loCaseInsensitive,
> loPartialKey]);

> The compiler generates:
>    Undeclared Identifier: 'loCaseInsensitive'.
>    Undeclared Identifier: 'loPartialKey'.

> I'm stumped...

> Jeff Hamblin

Other Threads