sdyates has asked for the wisdom of the Perl Monks concerning the following question:
I have the DB installed on windows, using 5.12. The password and users name I am using is root and the db and ip are correct - I use the same info on a mac client to connect to the db no problem (mac app, not command line). I am not even sure what data source name means. Sorry for the bad post, but I need to get something accomplished tonight and have already spent hours online trying to solve it. Thanks for your time, SDBI connect('d60380940:192.168.1.3','HASH(0x238b3c)',...) failed: [Mic +rosoft][ODBC Driver Manager] Data source name not found and no defaul +t driver specified (SQL-IM002) at CRTDBTBL.pl line 46 Cannot connect to the database ERROR: 1 ([Microsoft][ODBC Driver Manager] Data source name not foun +d and no d efault driver specified (SQL-IM002))
sub open_dbi { # Declare and initialize variables my $host = '192.168.1.3'; my $db = d60380940; my $db_user = root; my $db_password = root; # Connect to the requested server # my $dbh = DBI->connect("dbi:mysql:$db:$host", "$db_user", "$db_pa +ssword", {RaiseError => 0, PrintError => 0} ) or err_trap("Cannot con +nect to the database"); my $dbh = DBI->connect("dbi:ODBC:d60380940:192.168.1.3", {RaiseErr +or => 0, PrintError => 0} ) or err_trap("Cannot connect to the databa +se"); return $dbh; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Lost over DBI in perl
by Tux (Canon) on Aug 22, 2011 at 06:35 UTC | |
|
Re: Lost over DBI in perl
by kejohm (Hermit) on Aug 22, 2011 at 02:04 UTC | |
|
Re: Lost over DBI in perl
by kcott (Archbishop) on Aug 22, 2011 at 06:59 UTC | |
|
Re: Lost over DBI in perl
by jethro (Monsignor) on Aug 22, 2011 at 02:00 UTC | |
|
Re: Lost over DBI in perl
by Neighbour (Friar) on Aug 22, 2011 at 11:07 UTC | |
by sdyates (Scribe) on Aug 22, 2011 at 20:42 UTC |