FindKey() on index with multiple-key-index and using NOT ALL fields??!? 
Author Message
 FindKey() on index with multiple-key-index and using NOT ALL fields??!?

Hello,
suppose I have a table with a primary key made of multiple fields: lets say
field 1 = NAME
field 2 = CODE,

is it save to do a FindKey not using both fields but only one, like
FindKey([NAME]);

Thanx&
--
C U
[-]
W S



Wed, 18 Jun 1902 08:00:00 GMT  
 FindKey() on index with multiple-key-index and using NOT ALL fields??!?
Hello,

Did you read the help page for FindKey? The help file supplied with D4
explicitly addresses this question.

"If the number of values passed in KeyValues is less than the number
of columns in the index used for the search, the missing values are
assumed to be null." - Delphi Help

HTH,
Scott

Quote:

>Hello,
>suppose I have a table with a primary key made of multiple fields:
lets say
>field 1 = NAME
>field 2 = CODE,

>is it save to do a FindKey not using both fields but only one, like
>FindKey([NAME]);

>Thanx&
>--
>C U
>[-]
>W S



Wed, 18 Jun 1902 08:00:00 GMT  
 FindKey() on index with multiple-key-index and using NOT ALL fields??!?


Quote:
>Hello,
>suppose I have a table with a primary key made of multiple fields: lets say
>field 1 = NAME
>field 2 = CODE,

>is it save to do a FindKey not using both fields but only one, like
>FindKey([NAME]);

>Thanx&
>--
>C U
>[-]
>W S

Table1.KeyFieldCount:= 1;  { for the first field }

Heiko



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

 Relevant Pages 

1. FindKey() on index with multiple-key-index and using NOT ALL fields...

2. Findkey on Multiple field index

3. Using Findkey with MDX indexes.

4. Index does not exist and Record/Key deleted exceptions

5. Index on multiple fields

6. Multiple Fields lookup with index problem

7. ? Index does not exist; index: PrimaryKey

8. Generating Key Index Field Failure

9. Sorting Paradox Tables With Indexed Primary Key Fields

10. Field Index Out of Range when trying to re-open a table with a different index

11. Delphi2/BDE32 query not using index

12. List Index Out of Bounds with TListBox if not using MultiSelect

 

 
Powered by phpBB® Forum Software