
VB COM MTS Connect String Best Practice
I would highly recommend passing the Connect String as a parameter to the
method returning the recordset. The reason is that if you need to support
multiple databases (for example, Production, Test, Development...) then you
need to be able to change the target db from a login screen on your
application. Connect strings are relatively short so the overhead is small
for the flexability gained. Also, pay attention to subsequent emails
regarding INI files and Registry access. If you are running in a clustered
environment, you will NOT want to do Registry access (or really INI either
for that matter) unless you want to pull all of your hair out.
You also cannot create an object in MTS, set the connect string, then use it
later. Remember that MTS handles all pooling and sharing of objects.
HTH.
--
Mark Howell
dBToolWorks
Quote:
> Hi,
> We are implementing database-intensive VB COM objects under MTS that will
> hit SQL Server 7.0 When these objects are instantiated, where is the best
> place to get the connect string from?
> 1. System DSN with password in registry?
> 2. Hard-coded connect string in object (as in FMStocks)
> 3. Sent from calling application as parameter?
> 4. Separate application-specific registry entry
> Thanks,
> Calvin Fabre