The Connection String

[Previous] [Next]

In our examples, we've hard-coded the connection string in our data access components. This isn't what you should do normally. If you decide, for instance, to move your database to a different server or change the name of the database, you must modify and recompile these components.

It might be better to use an INI file for the data access package or a Registry entry, in which you store this information. Then you could use the Shared Property Manager (SPM) in COM+ or MTS to move that information into your data access package for fast and easy access.

We won't use any space here to show you how to code against the SPM. It's not very difficult; the MTS and COM+ documentation, as well as any of the books on MTS and COM+ we've listed in our bibliography, contains lots of help and information about that.



Designing for scalability with Microsoft Windows DNA
Designing for Scalability with Microsoft Windows DNA (DV-MPS Designing)
ISBN: 0735609683
EAN: 2147483647
Year: 2000
Pages: 133

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net