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
15/08/2005 03:31:50
 
 
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:
01040882
Views:
23
Alejandro,

I have similar requirements, and I'm sure you have thought it all through, but just in case...

This works for me:
* Make sure you've set up a working ODBC connection under 
* SYSTEM.DSN 

* I try to read the ODBC connection from an ini file

lcIniFile   = 'MyInit.ini'
lcSection   = 'SomeSection'
lcReadString= 'MyOdbcConnectionName'

gcServerDB   = oApplicationInit.ReadIniFile(lcIniFile, lcSection, lcReadString)

IF EMPTY(gcServerDB)
   * Log and close down
ENDIF

lnSql = SQLCONNECT(gcServerDB,.T.)
Open Database "Data\MyDb.dbc" Shared
Set Database To MyDb

* Form load
Use MyView Connstring lnSql In 0 NoData   && Remote view

* Form activate
Requery('MyView')
HTH

>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
Peter Pirker


Whosoever shall not fall by the sword or by famine, shall fall by pestilence, so why bother shaving?

(Woody Allen)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform