Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
INDEX on Cursor (How to do) ?
Message
 
À
04/08/2003 13:16:14
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00816541
Message ID:
00816739
Vues:
28
Donald,
As the others have said the Index on statement should use the Tag option so that the index is deleted with the cursor. Assuming the no other indexes are set up in other places in your code then the interactive change should use the correct index. I prefer to specify both the table and the index that way when I'm reading through my code I know exactly what is being searched for (especially here where the index order is being set in a different method).
INDEX ON ti_num TAG ti_num

=SEEK(.txtSrch.value, "DD_TASKINFOGrd", "ti_num")
but hey that's just my preference.
HTH
Caroline

>Caroline,
>
>Will the following code use the INDEX (see InteractiveChange() method)?
>
>form_Task.scx
>===============
>Init()
> SELECT ti_num, ti_type, ti_brief, ti_task, ti_incr, ti_rev, ti_id ;
> FROM DD_TASKINFO ;
> INTO CURSOR DD_TASKINFOGrd
> INDEX ON ti_num TO ti_num
>
> Thisform.grdSrch.RecordSource = "DD_TASKINFOGrd"
> Thisform.grdSrch.COLUMN1.ControlSource = "DD_TaskINFOGrd.ti_num"
> Thisform.grdSrch.COLUMN2.ControlSource = "DD_TaskINFOGrd.ti_brief"
> Thisform.grdSrch.COLUMN3.ControlSource = "DD_TaskINFOGrd.ti_rev"
> Thisform.grdSrch.COLUMN4. ....
> Thisform.grdSrch.COLUMN5. ....
> Thisform.grdSrch.COLUMN6. ....
> Thisform.grdSrch.COLUMN7. ....
>
>*!*// Adjoining TextBox for incremental search of Grid
>txtSrch.InteractiveChange()
> SELECT DD_TASKINFOGrd
> WITH thisform
> =SEEK(.txtSrch.value)
> IF EOF()
> GO BOTTOM
> ENDIF
> .grdSrch.valid()
> ENDWITH
Caroline
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform