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
31/10/2005 11:34:14
 
 
To
31/10/2005 10:28:32
General information
Forum:
Visual FoxPro
Category:
Client/server
Environment versions
Visual FoxPro:
VFP 8
Database:
MS SQL Server
Miscellaneous
Thread ID:
01039999
Message ID:
01063646
Views:
15
Alejandro,
You are right. I didn't consider that situation.

Another schema is to keep local copies of the DBC for every user, I don't know whether you like it.

Thanks anyway for your comment. The model I was working on was only for Administration purposes in order to change the active server for all users.



>Juan Carlos,
>
>Thanky ou for your answer. I believe DBSETPROP changes the DBC, right? In that case if a second user is using a different SQL database, for example for development, they would be stepping over each other, right? I thought about making a copy of the dbc and opening it with an alias, but unfortunately that is not possible.
>
>Thanks,
>
>Alex
>
>
>
>>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
Reply
Map
View

Click here to load this message in the networking platform