Jeff,
We have a similar situation in our shop, but it revolves around the need for
securing our passwords for the production databases from our development
staff. Instead of hardcoding the database, user name and password and other
values associated with the connection string in the ASP itself, the
developers go out and decrypt a connection string from a file housed on the
server. The connection string has the server name, the user name, password,
and the default database housed within it. Thus all the developer needs to
do is go out to the file, parse it, and keep that information during the
instance invoked by the user. It works very well and gives us the side
benefit of being able to change databases and servers when necessary without
having to redesign the application. Hope this helps.
BTW, IMO it is not good coding practice to resovle your database name in the
code itself. There is a slight performance increase by doing this, but it
is not worth the pain if you have to go through and redesign your
application because you need to move to another box or database. The only
time I specify the naming of a database is in a VIEW when I need to jump to
another database on the same server and pick up information for my
application. This at least gives you some level of abstraction.
Grant
[quoted text, click to view] "Jeff Sahol" <jsahol@yahoo.com> wrote in message
news:MPG.1a70e6af963c0219989680@news-server.triad.rr.com...
> I've been working with a client who has hard-coded the database name
> throughout the code, both client-side inline code (c#/asp.net) code and
> plsql. In other words, "select blah from MYAPP.dbo.tablename..." instead
> of "select blah from dbo.tablename". There is only one db in use.
>
> This has created problems on 2-3 occasions when they wanted to run a
> parallel system for test/demos, since the hard-coded name forces them to
> the "MYAPP" database even if they connect string specifies "OTHERAPP" as
> dbname.
>
> My question is, what is the accepted best practice for whether to
> include the dbname in object refs? I have been pushing for eliminating
> "MYAPP." but getting a lot of resistance, I guess I need to charge more
> before anyone will listen to me. Also, are there any acceptable
> workarounds to get a parallel system running without eliminating the
> dbnames, like aliasing or something?