Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Two queries SQLEXEC() on separate SQLhandle ?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Database:
MS SQL Server
Divers
Thread ID:
01147303
Message ID:
01147364
Vues:
33
Hi Marc,

>If I use two timers, is it possible to execute two different queries using SQLEXEC(), each on a different SQL handle provided with SQLCONNECT() ?

Yes, but you have to execute them asynchronously:
SQLSetProp(m.lnHandle,"Asynchronous",.T.)
SQLExec(m.lnHandle,"statement")
Repeat these steps for both handles. Then you can call SQLEXEC() with just the handle to find out if the query is still executing (return value is 0) or completed (return value is different from 0). BTW, asynchronous queries are built into VFP. You don't have to use a timer for that.

Asyncronous queries have to be supported by the ODBC driver that you use. In addition, it depends on the driver when they return. MS SQL drivers return pretty quickly after sending the statement to the server. Oracle's driver returns when the server sent back the first records. That's quick for simple queries, but can take a while if the server needs to process all records (ORDER BY, GROUP BY, etc.)
--
Christof
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform