Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine


by Anonymous Monk
on Dec 03, 2001 at 07:22 UTC ( #129027=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I am currently at the design stage of a system that will have parts of it written in perl. this system will be accessing multiple database servers which will be able to be added and removed from the system at anytime. Because of this I don't want to be giving the server with the system on it a dsn for every database server so what I am asking is .... is there a way of just reading details of a server from a database (no probs there) and then just from that info making contact to the external DB server. eg dynamically creating dsn's?

(hope this made sense)

btw this system will be run under a windows environment (I would rather *nix but this was not possible with some of the specifications)

Thanks in advance.

Matthew Frick

Replies are listed 'Best First'.
(crazyinsomniac) Re: DSN's
by crazyinsomniac (Prior) on Dec 03, 2001 at 07:37 UTC
Re: DSN's
by strat (Canon) on Dec 04, 2001 at 20:24 UTC
    By the way: if you are looking for the options to Win32::ODBC::ConfigDSN, just enter a DSN manually and then goto Registry into the following Branch:
    SystemDsn: HKEY_LOCAL_MACHINE\Software\ODBC
    UserDsn: HKEY_CURRENT_USER\Software\ODBC
    and browse through the subdirectories. If there you find a value like "Thrusted_Connection" with the value "Yes", then just use it about like that:
    if (Win32::ODBC::ConfigDSN( ODBC_ADD_SYS_DSN, "SQL Server", ( "DSN=$dsn", "DESCRIPTION=$dsnDescription", "SERVER=$sqlServer", "DATABASE=$database", "UID=$uid", "PWD=$password", "Trusted_Connection=Yes", ) ) ){ print ("DSN $dsn sucessfully created\n");
    That example was taken from MsSql-Server, but for the other ones it's just the same way.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://129027]
Approved by root
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2022-01-18 21:54 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (54 votes). Check out past polls.