Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Implementing a Browse with SQL Pass Thru
Message
 
To
04/02/2002 11:19:09
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00614848
Message ID:
00614856
Views:
29
>Hi,
>
>I want to browse a recordset produced by a SQL Select:
>
>nSQLHandle  = SqlConnect (cSQLDataSource, cSQLUserId, cSQLPassword)
>
>cSQLcommand = "Select * From MyTable"
>SqlExec (nSQLHandle, cSQLcommand, "CurSelect")
>Select CurSelect
>Browse
>
>The SqlExec function above will execute until all records contained in MyTable are moved to CurSelect, and then control will be passed back to the program. When the amount of records to be selected is very large this statement sequence is not a good choice, because the SqlExec will delay a lot of time and will bring lots of, perhaps, not desired records.
>
>The behavior I'm looking for is that one implemented by a regular FoxPro Browse statement when issued to a DBF file.
>
>How can I implement such a behavior, using SPT?
>
>TIA,
>
>Fernando
You can probably use an Asynchronous connection. That way, SQLExec will come back inmediatly and your browse will show up quickly.

HOWEVER (big HOWEVER <g>) working with asynchrounous connections is not as easy as it sounds. With an asynchronous you will need to be looping (probably in a timer) asking VFP if it has finished downloading records while the user is still browsing records.

Also, I have found scenarios where VFP does not work asynchronous (and thus the user needs to wait) even when the connection is asynchronous.

Anyway, you can problably play with it and see if it does what you need.
Hector Correa
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform