Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Connections questions
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00248175
Message ID:
00248367
Views:
17
I see that Ian has answered most of your questions. I'll see if I can fill in the rest.

>2) count total number of connections open (in VFP session)

For views, you could loop through all the work areas and use CURSORGETPROP('ConnectHandle) to see how many different handles there are. I don't think there's any way to figure out what manually opened connections you have, but you should be keeping track of that anyway.

>
>3) see total # of connections on SQL Server?
>

In SQL 7.0 you can go into Enterprise Manager. Expand the server, then Management, then Current Activity. Click on Process Info to see all the open connections.

>4) force a view to share a currently (manuall opened) connection ?
>

Views will share connections with each other, but you can't open a connection with SQLCONNECT() and then have a view share it. I find this very annoying but there doesn't seem to be a way around it. One thing you can do is get the user name and password from the user when the application starts. Put it in the connection you want to use using DBSETPROP(). Then open a view. Then remove the user/password from the connection. Now you can keep this view open as long as the application is running in order to hold its connection open. I usually get the view's connection handle and assign it to a property of my application object. Then I can use it with SQLEXEC() throughout the application. I also mark all of my views ShareConnection so they don't open any additional connections.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform