Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to change server and keep same dbc and remote view d
Message
De
15/08/2005 03:31:50
 
 
À
10/08/2005 16:53:40
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Versions des environnements
Visual FoxPro:
VFP 8
Database:
MS SQL Server
Divers
Thread ID:
01039999
Message ID:
01040882
Vues:
22
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)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform