Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Remote Views - Shared Connections - NOT!
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01224224
Message ID:
01224235
Views:
12
You have to set each view to use Share Connection. You can do that using DBSETPROP() or View Desiner -> Query -> Advanced options.

The CURSORGETPROP("ConnectHandle") returns statement handles not connection handles. Each view can have its own statement handles but use the same connection. You can use SQLGETPROP(..., "ODBChdbc") to check connection handle.

>
>I am working on a Visual FoxPro 9.0 SP2 application hitting on Microsoft SQL Server using Remote Views and SPT. The Remote Views are all set to share a connection (verified via Query > Advanced Options). The name of the Connection is CONNECTION_1100 for all of them.
>
>The original application was making separate connections (and then calling a Stored Procedure to grant appropriate roles) for EACH option within the application. I have refactored this to make only one connection (using the above name) at application start-up and set the role there; all options now use the connection handle created and stored at application launch as needed.
>
>The problem I am having with the remote views is that although the named connection in the views is the same as above, a second (third, etc.) connection is made when the view is opened.
>
>
>To troubleshoot this outside the application I run the following code, which opens two of the views.
>
>USE rv_sheet_column
>? CURSORGETPROP("ConnectHandle","rv_sheet_column"), CURSORGETPROP("ConnectName","rv_sheet_column")
>SELECT 0
>USE rvl_product
>? CURSORGETPROP("ConnectHandle","rvl_product"), CURSORGETPROP("ConnectName","rvl_product")
>
>
>What I get is:
>1 CONNECTION_1100
>2 CONNECTION_1100
>
>Note that if I don't select a new work area (via SELECT 0) the second view does indeed use the same connection handle.
>
>I've not heavily used Remote Views in the past, so I appreciate any help. What do I need to do to ensure all views use the same connection created at application start-up?
>
>Thanks.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform