Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to change server and keep same dbc and remote view d
Message
From
28/10/2005 23:19:04
 
 
To
10/08/2005 16:53:40
General information
Forum:
Visual FoxPro
Category:
Client/server
Environment versions
Visual FoxPro:
VFP 8
Database:
MS SQL Server
Miscellaneous
Thread ID:
01039999
Message ID:
01063215
Views:
12
Alejandro

I did this some months ago:

Build and Launch a Connection Screen to capture Server, Database, etc.

Build your connection string by code and store it to a variable like m.gcConn
m.gcConn =  "Driver=SQL Server" + ;
			";Server=" + allt(m.gcServer) + ;
			";Database=" + m.gcBase + ;
			";UID=" + allt(Thisform.txtcUID.Value) + ;
			";PWD=" + allt(Thisform.txtcPWD.Value) 
Since you said you have a unique connection, then set this property:
	OPEN DATABASE YourDBC
	SET DATABASE TO YourDBC
	DBSETPROP('YourConnection','connection','ConnectString', m.gcConn)
With this approach, your remote views in the form's dataenvironment will work without changes.




>We have a dbc that has a single named connection and several remote views and life has been good.
>
>We now wish to give the option to connect to any of several servers that have identically named databases with the same structure as the original one. We tried SQLSTRINGCONNECT() with the appropriate connection string to the second server but data keeps coming from the original server.
>
>Whan can be the problem?
>
>Than you very much.
>
>Alex
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform