Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQLEXEC and Shared Connection Problems
Message
From
11/11/2004 13:57:51
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8
OS:
Windows XP SP1
Database:
MS SQL Server
Miscellaneous
Thread ID:
00960314
Message ID:
00960572
Views:
9
Hi Bernard,

The "ConnectBusy" property checks the status for the SPT connection handle you are passing to SQLGETPROP. In the example, lnhandle is not busy, but the CURSORGETPROP("ConnectHandle","MyRemoteView") is. Note, in most scenarios, if AllowSimultaneousFetch=.T. for the busy connection handle, you should still be able to execute command through another SPT connection handle that uses the same ODBC connection. In your example, you should still be able to execute something through lnhandle even though the MyRemoteView is still fetching.

Thanks,
Aleksey.



>Hi,
>
>I'm having a little difficulty determining the busyness of a shared connection when using a combination of remote views and cursors created via SQLEXEC calls.
>
>The problem seems to be that whenever I check the busyness of the connection using the statement handle returned from the SQLCONNECT command it always returns .F. when it should return .T.
>
>Say we have a connection set up as follows ;
>
>CREATE CONNECTION Connection1 CONNSTRING 'driver=SQL SERVER;server=(local);uid=SA;pwd=SA;database=MyDataBase'
>
>And a remote view set up in the following way ;
>
>CREATE SQL VIEW MyRemoteView REMOTE CONNECTION Connection1 SHARE AS SELECT * FROM SOMEBIGTABLE
>DBSETPROP('MyRemoteView','View','AllowsimultaneousFetch',.T.)
>DBSETPROP('MyRemoteView','View','Fetchasneeded', .F.)
>DBSETPROP('MyRemoteView','View','Fetchsize', 100)
>DBSETPROP('MyRemoteView', 'View', 'ShareConnection', .T.)
>
>IF I run my view and after the first 100 records are returned, then test the busyness of the connection it works fine. ie
>
>USE MyRemoteView
>llBusy = SQLGETPROP(CURSORGETPROP('ConnectHandle'), "ConnectBusy")
>
>The the llBusy variable equates to TRUE.
>
>Now if I attempt to open the above remote view and then create a statement handle via a call to SQLCONNECT the busy status doesn't behave itself... ie
>
>USE MyRemoteView && begin to download the large recordset
>* now get a handle onto the shared connection
>lnhandle=SQLCONNECT('Connection1',.T.)
>* test to see if the shared connection is busy, it should be!
>llBusy = SQLGETPROP(lnhandle,"ConnectBusy")
>
>The llBusy returns FALSE
>
>My understanding is that the statement handle returned from the SQLCONNECT command is using the shared 'Connection1' connection. The SQLCONNECT command should be using a previously shared connection as I've set the second parameter on the SQLCONNECT to true.
>
>Any body got any ideas?
>
>Thanks, Bernard
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform