Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Suppressing message during SQLEXEC
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00020169
Message ID:
00020904
Vues:
47
>>>That would be a good solution if we could allow program execution to continue but we can't. Usually the next form to display depends on the contents of the cursor being built so we have to wait. Any other ideas? Thanks for your help!
>>
>>As I understood you don't want the "Executing Remote... Press ESC to cancel." message from appearing, so the setting I talked about will take care of this issue.
>>
>>what do you mean by "Usually the next form to display depends on the contents of the cursor being built so we have to wait", please explain.
>
>We are developing a system that displays information that is kept by geographical area and time period. The user first has to select the geographic area. This is done by clicking the appropriate button on a form which then runs a query to determine the time periods available for that geography. This query has to be complete before the time period selection form can be displayed.
>
>The help file for SQLEXEC says that to run a query in asynch mode you have to keep executing SQLEXEC until it returns something other than 0. Here's the code I used to test this:
>
>*********************************************
>lnResult = 0
>
>DO WHILE lnResult = 0
> lnResult = SQLEXEC(myhandle,"SELECT * FROM Siccode")
>ENDDO
>
>RETURN
>
>*********************************************
>
>When this code runs, the "Executing Remote... Press ESC to cancel." message flashes on and off while the query runs!
>
>I guess I'm missing something here. Any ideas? Thanx!

When you execute an asychronous query you only need to wait for enough data to display on your form. FoxPro will grab records in blocks. The number of records in a block is determined by your "Records to Fetch at a Time" setting on the "Remote Data" tab in Tools/Options. You can also set this using CURSORSETPROP("FetchSize", nSize) or if you are using a remote view DBSETPROP(cViewName, "VIEW", "FetchSize", nSize). Specifying -1 for the FetchSize retrieves all the records at once (or MaxRecords if that is set). If you want to wait for all the records I'd set Asynchronous to .F. You can set this using SQLSETPROP(nConnectionHandle, "Asynchronous", lTrueFalse). To set this for the FoxPro default use 0 (zero) as your connection handle (this is the same as setting it in Tools/Options).
Rob Giorgi
Personal: EMail rjgiorgi@hotmail.com
Company: EMail robert.j.giorgi@lmco.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform