Board index » delphi » Setting alias server name at runtime

Setting alias server name at runtime

Hi,
I am using Delphi 4 with Oracle and have the following requirement.

I need to be able to change the SERVER NAME value in an alias at runtime. I
know it would be more usual to allow the user to select a different alias but
due to the size of the system it is not practical to change it to support
this.

If we could change the server name depending on a user input it would get
round this problem.

Any help greatly appreciated.

Thanks

Richard Warriner

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    

 

Re:Setting alias server name at runtime


Hello,

Use the component Tdatabase and all you'll  have to do is to change the
property params of the Tdatabase.

ie:
database.close;
database.params[0]:='server name=yourservername'; {change the number of the
line if it somewhere else}
database.open;

note that this will closes all dataset objects using the tdatabase.

Hope it will help.

Hugues.

rich...@zoril.demon.co.uk a crit dans le message
<7fpcq0$c4...@nnrp1.dejanews.com>...

Quote
>Hi,
>I am using Delphi 4 with Oracle and have the following requirement.

>I need to be able to change the SERVER NAME value in an alias at runtime. I
>know it would be more usual to allow the user to select a different alias
but
>due to the size of the system it is not practical to change it to support
>this.

>If we could change the server name depending on a user input it would get
>round this problem.

>Any help greatly appreciated.

>Thanks

>Richard Warriner

>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own

Other Threads