Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Instant Connection Break ?
Message
From
27/02/2006 00:49:34
Vladimir Zhuravlev
Institute of the Physics of Earth,Russia
Moscow Region, Russia
 
 
To
21/02/2006 10:19:16
General information
Forum:
Visual FoxPro
Category:
Client/server
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
MS SQL Server
Miscellaneous
Thread ID:
01097737
Message ID:
01099355
Views:
17
>I've noticed when using Access, if I need to "kill" a running query all I need to do is press the + keys and the query stops almost instantly. However, when I need to kill a VFP remote connection view/query, it sometimes takes forever for VFP to release the query. I have ESC set ON so that's not the problem. In both examples, Accesss vs. VFP, both are connected to the same MS SQL back-end. It appears that Access is much more efficient in communicating with SQL to release the connection than VFP. Am I missing something? Has anyone written a PRG or utility that caused a remote view connection to "die" instantly when requested?
>
>Thanks,
>Robert Wright
Hello Robert

If the query time is big, I use asynchronous coonection type
sqlsetprop(conhandle,'Asynchronous',.t.)
In this mode we wait for result in the loop
m.res=sqlexec(conhandle,m.sql,'cursor')

do while m.res=0
*put here testing keyboard on some symbol
** for example using charsaw function
** if you see it, make sqlcancel
m.res=sqlexec(conhandle,m.sql,'cursor')
enddo
sqlsetprop(conhandle,'Asynchronous',.f.)
**
I also use setting fetchasneeded and fetsize properties of the cursor to
make 'step' query
There is also other way to make 'step' queries of the big tables
To use server hints
Let we have table with som index can be used for ordering
we make query like this
select top 100 * from table (with(someindex)) order by name
someindex is built on field name
This query will run fast
We go bottom in the cursor on the client
and keep in some variable last value on field name
Let it will be m.name=cursor.name
Next query we send to server will be like this
select top 100 * from table (with(someindex)) order by name where name >?m.name
So we can put making these queries in circle on VFP client
and can stop at any step, if we need it
At the time we stop we have few cursors at client

Best wishes, Vladimir
MVP-2006-2011, PHD in Math and Physics ,
host of www.foxclub.ru,
VFP lector at Interface and Microinform companies
Head science researcher of VNIIA Rosatom.
Previous
Reply
Map
View

Click here to load this message in the networking platform