FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Multiple Sql Indexes - Rao
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Multiple Sql Indexes - Rao
Posted: Tue May 30, 2023 06:39 PM

I have a single Sql table oRs and I want to have 2 lookup options or Sql indexes on the same recordset .. This dataset is for a local town park where you have information on Owners ( name ) and pets by name .

I want to be able to have a single recordset where I can use a radio option to search on either an owner name or a pet name without having to re-create the same recordset ordered by OwnerName and or by Pet name ..

Like in dbfcdx .. you create a .dbf with two tags and you can on the fly set order to ownername or petname .. is this possible in ADO Sql ?

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Multiple Sql Indexes - Rao
Posted: Tue May 30, 2023 06:56 PM
We do not need to create indexes at all.
Just set order to the column name we want like this:
Code (fw): Select all Collapse
oRs:Sort := "OwnerName"
// or
oRs:Sort := "PetName"
Or use the default AUTOSORT clause of Xbrowse and use Incremental search
Regards



G. N. Rao.

Hyderabad, India
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Multiple Sql Indexes - Rao
Posted: Tue May 30, 2023 07:32 PM

Rao

Brilliant ... been working on this RUSH project .. Thank You, Rick

Continue the discussion