powerhouse has asked for the wisdom of the Perl Monks concerning the following question:
Like I mentioned above the Database is actually on a remote windows machine. The machine I'm installing this on, is the unix machine that I have my website running on.Useless use of private variable in void context at Makefile.PL line 43 +1. Configuring DBD::ODBC ... >>> Remember to actually *READ* the README file! And re-read it if you have any problems. Using DBI 1.48 (for perl 5.008004 on i686-linux) installed in /usr/lib +/perl5/site_perl/5.8.4/i686-linux/auto/DBI/ The DBD::ODBC module needs to link with an ODBC 'Driver Manager'. (The Driver Manager, in turn, needs one or more database specific ODBC + drivers. The DBD::ODBC module does _not_ include any ODBC drivers!) You need to indicate where your ODBC Driver Manager is installed. You can do this ether by setting the ODBCHOME environment variable or by runing 'perl Makefile.PL -o odbcdir'. If you do not have an ODBC Driver Manager you can try building the free iODBC Driver Manager in the iodbcsrc directory. Makefile.PL aborted.
So, that being the case, would this code:sub ConnectToDB { my $host_name = "01.002.003.04";# Ip Address Here my $db_name = "DataBaseName"; # Database Name to connect t +o my $dsn = "DBI:mysql:host=$host_name;database=$db_name"; return (DBI->connect ($dsn, "usernameHere", "PasswordHere" +, {PrintError => 0, RaiseError => 1})); }
Login to the remote access db?sub ConnectToDB { my $host_name = "002.003.004.05"; my $db_name = "DBName"; my $dsn = "dbi:ODBC:Clients:host=$host_name;database=$db_n +ame"; return (DBI->connect ($dsn, "UserNameHere", "PassWordHere" +)); # Clients being the name I set in the Windows Data Sources (ODBC) }
set-up these environment variables:
DBI_DSN The dbi data source, e.g. 'dbi:ODBC:YOUR_DSN_HERE'
DBI_USER The username to use to connect to the database
DBI_PASS The username to use to connect to the database
ODBCHOME (Unix only) The dir your driver manager is installed in
perl Makefile.PL
make (or nmake, if VC++ on Win32)
make test (or nmake, if VC++ on Win32)
Where do I specify those at?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help with installation and use of the DBD::ODBC module
by Errto (Vicar) on Oct 24, 2005 at 04:58 UTC | |
by EvanCarroll (Chaplain) on Oct 24, 2005 at 05:05 UTC | |
by Errto (Vicar) on Oct 24, 2005 at 05:15 UTC | |
|
Re: Help with installation and use of the DBD::ODBC module
by EvanCarroll (Chaplain) on Oct 24, 2005 at 04:49 UTC |