Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Connection String
Message
 
 
To
21/06/2006 14:53:51
Randy Hooper
Ranco Business Software
Tampa, Florida, United States
General information
Forum:
Visual FoxPro
Category:
Client/server
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01130047
Message ID:
01130699
Views:
19
Randy,

If you attach all your remoteviews to a single connection in the DBC, then you can just swap out the connectstring with a chunk of code:
if ( "office machine name" $ lower( sys(0) ) )
   lcOld = "homename"
   lcNew = "officename"
else
   lcOld = "officename"
   lcNew = "homename"
endf

? dbsetprop( "sqlConnection", "connection", "connectstring", 
   strtran( dbgetprop( "sqlConnection", "connection","connectstring" ), lcOld, lcNew ) )
>David, thanks for the reply.
>this has me very confused, I have made a connection called pcrconnect and have built my remote views as the data source pcrconnect I'm using a IP address that will allow me to hit the server in our office from my home office. So what I did I change the IP address in the pcrconnect connection to the name of the server in our office and recompiled the code and installed the exe on a work station in our office. I would have thought at this point this would work.
>
>But what is happening I get a connection failure and then the SQL server dialog box comes up with the IP address I used from my home office and not the name of the server. I can drill down and pick the server I want and all works well.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform