Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Shared connection
Message
From
15/11/2001 04:55:53
 
 
To
14/11/2001 23:37:43
Wilfred Chan
Bnp Paribas Hong Kong Branch
Hong Kong, Hong Kong
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00581901
Message ID:
00581943
Views:
21
This message has been marked as the solution to the initial question of the thread.
Hi!

You can share only connection that is in the DBC. THis means that when remote view is opened, it will use the connection from the database to connect. Any connection handlers created by connecting using SQL Pass-Through commands will not be used by views. You can do opposite though: open the remote view (that will connect using connection from database), then use CursorGetProp("ConnectHandle") for that view. In such case and in only such case connection will be chared, but that connection is created ONLY by the DBC connection object.

This is a well-known security problem, and usually workaround is to re-create the database loaclly at the client computer temporary directory by creating connection and all views programmatically.

In VFP7 there is a new feature for "USE" command - for remote view you can specify explicitly the connection string. So in VFP 7 you can do such thing, but it will not be a shared connection (correct me if I'm wrong here), and it will look somewhat differently:

1. In the VFP setting, checked the "Share connection" and saved as default.
2. Create a database, create a valid connection with "connection string".
3. Add a view using that connection and set it as "shared connection".
4. Modify that connection and put dumpy "aaaa" in the PWD and UID.
5. Open the view: USE MyDBC!TEST1 CONNSTRING 'DSN=testdb;UID=dba_test;PWD=test;SERVER=testdb;'

HTH.

>Hi,
>
>I've read a lot of articles about using Shared connection but I failed to make it. Thank you for your help.
>What I've done are:
>1. In the VFP setting, checked the "Share connection" and saved as default.
>2. Create a database, create a valid connection with "connection string".
>3. Add a view using that connection and set it as "shared connection".
>4. Modify that connection and put dumpy "aaaa" in the PWD and UID.
>5. Establish a connection :
> n1=sqlstringconnect('DSN=testdb;UID=dba_test;PWD=test;SERVER=testdb;')
> The n1 is work. I've tested it by SQLEXEC().
>6. Use the remote view: USE TEST1.
>
>But I always got a message ->Connectivity error: invalid username/password.
>
>Did I miss something ?
>
>Wilfred
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