If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Connection string, where to store ?

Hi.
I'd like to read from you opinions regarding where to store the connection
string setting on a n-tier application. Currently I use the windows registry
of the application server (COM+) machine, and all my objects read that
setting before opening any connection. Does it affect the system
performance? Do you have any comments or other suggestions?
I've seen people store the connection string in a .asp include file and pass
the connection string as a parameter to the methods in the objects.

Re: Connection string, where to store ?

Re: Connection string, where to store ?

Sergio -

You could use COM+ constructor string to administrativly assign a connection
string if you have objects hosted in COM+. Also you can use a UDL file.
This will atomatically be cached by the system and you just specify your
connection string as "file name=C:\my\path\myUDL.udl". The udl file has
all the connection info in it. You must be carefull not to expose that UDL
file in any way to the outside world. This is one reason that it is not
a good idea to put it in an ASP file. Some one could get the source to that
file through an IIS hack. Then they know more than you'd like them too.

Re: Connection string, where to store ?

John,
So you objects access the file, parse it and extract the connection string
on every need for a connection or do you cache the connection string somehow
?
The good thing about the registry is that is has a separate security setting
and systems administrators are familiar with it.
My concerns are security, performance and ease of administration (the later
is not so important as the other two)

Thaks for the feedback!

Sergio

"John Cantley" <jcstrider@hotmail.com> wrote in message
news:3ac395fc$1@news.devx.com...
> Sergio,
>
> I have started using XML for all my application settings.
>
> John
>
>

Re: Connection string, where to store ?

Ian,
This sounds great! If I use the connection string based on a UDL file then
ADO/OLEDB will not read the file everytime I need a new connection? This
would be fast.

Thanks!

Sergio

"ian drake" <ian.drake1@home.com> wrote in message
news:3ac39dda$1@news.devx.com...
>
> Sergio -
>
> You could use COM+ constructor string to administrativly assign a
connection
> string if you have objects hosted in COM+. Also you can use a UDL file.
> This will atomatically be cached by the system and you just specify your
> connection string as "file name=C:\my\path\myUDL.udl". The udl file has
> all the connection info in it. You must be carefull not to expose that
UDL
> file in any way to the outside world. This is one reason that it is not
> a good idea to put it in an ASP file. Some one could get the source to
that
> file through an IIS hack. Then they know more than you'd like them too.
>
> Hope this help,
> Ian Drake
>
>

Re: Connection string, where to store ?

Sergio -

If you are going to use a UDL, just NEVER move that udl file from the place
where you started using it to a new location. Because it's cached wierd
things start happening. All you'll have to do is recreate that UDL file
in the new location. I got very criptic errors when I moved a udl file after
it had been used. It's just strange, so watch out.