Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Populating List Box from Table
Message
 
 
À
24/10/2001 04:54:59
Ashish Patel
Hindustan Petroleum
Mumbai, Inde
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00572474
Message ID:
00572480
Vues:
30
Hi!

First of all, change your filter expression so it will be optimizable:
set filt to natur_code = "4" and ctaout_dt<>{} and tvout_dt<>{}

and index table on the natur_code, ctaout_dt and tvout_dt fields. This should speed up the work, though I recommend you to use a query in the Load event of the form and use queries alias as a source for your listbox:

SELECT consumer.cons_no,consumer.name from consumer WHERE natur_code = "4" and ctaout_dt<>{} and tvout_dt<>{} into cursor consumersLookup nofilter

Of course, indexes are still required to optimize query.

Finally, if you have 1000+ records in a result to populare listbox, listbox works slow because it designed originally with purpose to display well only little number of rows (less than 256). Use the grid control for this. You can make grid looks like a listbox using the tips from FAQ#8092.

BTW, assure SET OPTIMIZE is ON to use Rushmour optimization for query or filters.


>I am having a form on which one of the text box is to capture consumer No. If the user doesn't know the consumer No, next to text box I have provided one button (help button). When user clicks on that button then one list box will be displayed with consumer No and Name. So that when user clicks on any no the consumer no text box will get populated with that consumer no. It is working fine. But it is too slow. Because I am not picking the consumers records as it is. In the Load event where I am using the consumer file I am using the command set filt to natur_code = "4" and not empty(ctaout_dt) and not empty(tvout_dt)
>and in the list box I have given the recordsource = consumer.cons_no,name.
>
>When my form starts it takes nearly 15 seconds to display the form. I am having nearly 25000 records in consumer master and also dbf is having nearly 40 fields. I ma using free tables.
>
>Can I expidite this ?
>
>
>Pl. Help.
>
>Thanks in Advance.
>
>Ashish Patel
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform