Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setting progressbar from remote query
Message
From
13/11/2001 05:22:01
 
 
To
13/11/2001 04:16:46
Vladimir Zhuravlev
Institute of the Physics of Earth,Russia
Moscow Region, Russia
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00580771
Message ID:
00580778
Views:
16
Hi!

Vladimir, it is not possible with remote data because the largest query part in such case is downloading data from teh server through network that is not interruptible by any normal VFP means.

You can use some very complex workarounds, though.

The most simple is to use a remote view with Fetch As Needed option switched on. When running a query, setup the progress bar and then run the requery() for view. Firstc all returns 100 first records. Skip 100 will cause next 100 records downloaded and so on. You can check if downloading is still in progress by checking if connection used by view is busy. This way you alsow will not know the total number of records till you get all records. To know this, you will need to do even more - get a number of records, that could be a hard thing. Also, remote view does nto allow to run SP or some complex scripts to get data. Anyway, you can do following: make an sp that does all data processing at the server side and put the result data into the temporary table. then your remote view will just query that temporary table. Run SP in asynchronous mode, check its status by separate connection to see its progress using some table. In the SP update status of SP running in that table. This splits progress bar updating to 2 parts (sp running and downloading data using remote view with fetch as needed option). This entire process is much slower than just plain getting data from SQL Server, but it allows progress bars. Remote view is not usable by other users during data downloading by view when it is located in shared database, so you require to make that remote view in local database. This way of working require at least 2 separate connections to server, that can have problems when dealing with SQL Server licensing. There might be other issues that I cannot remember at this moment...

Another approach is to switch on the satatus bar, set _VFP.AutoYield to .T. and see progress of downloading of the SPT cursor in the status bar as number of records in the cursor. Tis is very simple but very ugly. Using API you can write a C++ or other language ActiveX that will hook into the VFP Window objects and catch the moment of updating the status bar by that information. Strip out the number of records downloaded so far and display it in another manner. Again, this will not give you the total number of records...

I do not have any other solutions handy...

>Some of the forms could have big queries
>To provide progressbar I did self made class , which has methods of setting
>time progress
>For file server queries I put this method directly in select clause, like one of the fields to select
>So, when long query runs, progress bar moves timemeter
>Is it possible to do similar thing for remote query for example on SQL server or Oracle
>Thanks in advance, Vladimir
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform