Board index » delphi » Searching on an secondary index with pascal database

Searching on an secondary index with pascal database

I have dynamically built a table at runtime and created a compound key
try
      DataMod.ViewDataTable.AddIndex
          ('Index1', 'Product Id; Vendor Name; Vendor Num', [ixPrimary]);

I can use FindNearest to locate a value in a Product Id field but I need to
also to find data using the Vendor Name or Vendor Num fields as well.
I still want to use something like FindNearest so that the cursor will move
to the closest match.

How can you search on these other fields. They are created physically in the
order shown above.

Thanks

 

Re:Searching on an secondary index with pascal database


If you need to find just the Vendor Name or Just the Vendor Num, the build
additional indexes on those keys.  Then before you use FindNearest set the
IndexName of the table.

   DataMod.ViewDataTable.AddIndex
          ('VendName', 'Vendor Name', []);

   DataMod.ViewDataTable.AddIndex
          ('VendNum', 'Vendor Num', []);

Regards,
-Steve-

Quote
"Jeff Howard" <jhow...@cubsican.com> wrote in message news:3a364fc2$1_1@dnews...

I have dynamically built a table at runtime and created a compound key
try
      DataMod.ViewDataTable.AddIndex
          ('Index1', 'Product Id; Vendor Name; Vendor Num', [ixPrimary]);

I can use FindNearest to locate a value in a Product Id field but I need to
also to find data using the Vendor Name or Vendor Num fields as well.

I still want to use something like FindNearest so that the cursor will move
to the closest match.

How can you search on these other fields. They are created physically in the
order shown above.

Thanks

Re:Searching on an secondary index with pascal database


I tried that but when I do not specify an option and just put [] then I get
a message "Invalid index/tag name for both indexes when I try to create it.

I can specify ixunique for the product id but for vendor name or vendor
number I also get an error message when I try to build the index?

What I am I doing wrong?

Quote
"Jeff Howard" <jhow...@cubsican.com> wrote in message

news:3a364fc2$1_1@dnews...
Quote
> I have dynamically built a table at runtime and created a compound key
> try
>       DataMod.ViewDataTable.AddIndex
>           ('Index1', 'Product Id; Vendor Name; Vendor Num', [ixPrimary]);

> I can use FindNearest to locate a value in a Product Id field but I need
to
> also to find data using the Vendor Name or Vendor Num fields as well.

> I still want to use something like FindNearest so that the cursor will
move
> to the closest match.

> How can you search on these other fields. They are created physically in
the
> order shown above.

> Thanks

Re:Searching on an secondary index with pascal database


What type of tables are you using?  dBase, paradox, etc?

-Steve-

Quote
"Jeff Howard" <jhow...@cubsican.com> wrote in message news:3a365ee4$1_2@dnews...

I tried that but when I do not specify an option and just put [] then I get
a message "Invalid index/tag name for both indexes when I try to create it.

I can specify ixunique for the product id but for vendor name or vendor
number I also get an error message when I try to build the index?

What I am I doing wrong?

Re:Searching on an secondary index with pascal database


I am using Paradox. I ended using the ixCaseInsensitive option and now it
works but I still have a problem becuse the fields are defined as
AlphaNumeric and are case senstive so my search is not entirely accurate?

Quote
"Steve Zimmelman" <s...@no.spam.psimed.com> wrote in message

news:915o0c$l2p2@bornews.inprise.com...
Quote
> What type of tables are you using?  dBase, paradox, etc?

> -Steve-

> "Jeff Howard" <jhow...@cubsican.com> wrote in message

news:3a365ee4$1_2@dnews...
Quote
> I tried that but when I do not specify an option and just put [] then I
get
> a message "Invalid index/tag name for both indexes when I try to create
it.

> I can specify ixunique for the product id but for vendor name or vendor
> number I also get an error message when I try to build the index?

> What I am I doing wrong?

Other Threads