Remote Login, using dbi:ODBC
- From: rjones@xxxxxxxxxx (Richard)
- Date: Sun, 23 Oct 2005 01:33:08 -0500
I login to my remote mysql databases, using perl, this way:
sub ConnectToDB
{
my $host_name = "01.002.003.04";# Ip Address Here
my $db_name = "DataBaseName"; # Database Name to connect to
my $dsn = "DBI:mysql:host=$host_name;database=$db_name";
return (DBI->connect ($dsn, "usernameHere", "PasswordHere",
{PrintError => 0, RaiseError => 1}));
}
So, to connect to a Remote Access Database, can I use this:
sub ConnectToDB
{
my $host_name = "002.003.004.05";
my $db_name = "DBName";
my $dsn = "dbi:ODBC:Clients:host=$host_name;database=$db_name";
return (DBI->connect ($dsn, "UserNameHere", "PassWordHere")); #
Clients being the name I set in the Windows Data Sources (ODBC)
}
Is that how I would connect to this database?
I would appreciate any help you could give me.
Thanks!
Richard
- Prev by Date: Re: DBD::Oracle for Oracle instantclient 10
- Next by Date: Re: Frustrated with do()
- Previous by thread: Re: DBD::Oracle for Oracle instantclient 10
- Next by thread: RE: Remote Login, using dbi:ODBC
- Index(es):