Table.Locate options for multiple field searches 
Author Message
 Table.Locate options for multiple field searches

Hello fellow experts,

I am having some trouble setting the proper options in a table.locate
method. I have done locates
before with single field with no problem. However, I am now trying to
search a table based on
multiple fields and I am having trouble with the parameters.

I am using delphi 2.

I have a table, let's call it table1, with fields : f1,f2,f3,f4,f5 (for
simplicity sake).

I am searching on f1 and f2, which are both A fields (string). I am looking
for the values
'Val1' and 'VAL2' in these two fields/columns in the table.

I do the following:

    table.locate('f1;f2',['VAL1','VAL2'],[])    I get the compile error
"Ordinal type required'

I try this

   table.locate('f1;f2','VAL1;VAL2',[])     which compiles fine but when
during runtime I get the error
                                                       "variant is not an
array"

I have tried other combination but to no avail.

Can any one help? I know I probably have the fundamentals wrong.

Thanks in advance,

Peter Cheung



Wed, 18 Jun 1902 08:00:00 GMT  
 Table.Locate options for multiple field searches
Hi! Peter.

Quote:
>     table.locate('f1;f2',['VAL1','VAL2'],[])    I get the compile error
> "Ordinal type required'

> I try this

>    table.locate('f1;f2','VAL1;VAL2',[])     which compiles fine but when
> during runtime I get the error
>                                                        "variant is not an

array"

This works.

  table1.locate('f1;f2', varArrayOf([val1, val2]), []);

--------
Fujinaka Rika



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to use Table.Locate method for more than one fields search

2. Searching multiple fields in a Table.

3. Help : Using LOCATE with multiple fields

4. Locate on multiple tables ...

5. Table.Locate with multiple partial parameters

6. Search on multiple fields

7. how to search a field for multiple strings?

8. Multiple Searching a Table

9. Table Locating with Paradox in a numeric field

10. Filtering tables on Multiple Fields

11. DBase Tables and Master detail on multiple fields

12. multiple record locates?

 

 
Powered by phpBB® Forum Software