Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Two queries SQLEXEC() on separate SQLhandle ?
Message
 
To
21/08/2006 11:01:52
General information
Forum:
Visual FoxPro
Category:
Client/server
Environment versions
Visual FoxPro:
VFP 9 SP1
Database:
MS SQL Server
Miscellaneous
Thread ID:
01147303
Message ID:
01147364
Views:
25
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
Previous
Reply
Map
View

Click here to load this message in the networking platform