Thank you Peter and Borislav.
I am finally implementing your suggestion and find that when I combine the CONNSTRING lnConnection clause with ALIAS an error occurs (1541 connection busy). I have not found this as a documented limitation. Do I have something wrong?
Thank you,
Alex
>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
>
>* 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