Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Rushmore and some DB question (sorry, pls refer to this
Message
 
 
À
30/09/2000 11:43:28
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00423110
Message ID:
00423121
Vues:
18
>1. When I need to use LOCATE FOR to search my data, do I need to SET ORDER TO myTag before issue LOACATE command? I heard that FOR need index to optimize the searching, is it? However, if Issue SET ORDER TO myTag before LOCATE, it is also time consuming for reorder the index. Any Idea?

No, you do not need to use SET ORDER TO command before search using LOCATE command.

>
>2. !DELETED() is not optimized. What should I do if I need to search for those undeleted record frequenty?

Make a tag for table with expression 'DELETED()'

>
>3. Does SQL statement in VFP optimized? If I need to search user records from vfp table and add it into listbox, do you prefer SQL statement into array, then loop through array to add the list or use LOCATE FOR ... WHILE NOT EOF() ...CONTINUE command to do this? why?

Yes, SQL SELECT and other SQL statements in VFP all are optimized.
Why use 'SELECT' instead of locate or SCAN FOR? Because you will be compartible with new ways of programming. This means that you will need to do little of work when you will move to the SQL Server, for example. That is why SELECT ... INTO CURSOR is recommended. Sometimes it is slower, but usually it is not a problem for combobox with rarely have more than 100-200 items.

>
>4. If I have a table which save the list of setting for each company door (door access system), and I would like to let user to modify/delete more than one setting at the sometime and update batch. Since i am using ADO (for example), wat method should I use to update those deleted / updated record? Again, it should enforce the integraty.

I don't know exactly, but probably ADO have such thing as table optimistic buffering mode. In VFP it looks as following:
1. Open table/view in optimistic table buffering mode.
2. After changes use tableupdate() command to update records, inside of transaction. If failed - rollback transaction and show message about integrity rules failed.
3. To get message of what is incorrect during batch update, you can use array as last parameter of tableupdate(), as well as you can use aerrors() function to get all details.

I suppose something like above exist for ADO too.
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