in reply to Re^2: dbi:ODBC change Port
in thread dbi:ODBC change Port
The second parameter to DBI->connect is the username and the third parameter is the password. You are passing in the options hash:
DBI->connect( "dbi:ODBC:Driver={$ODBCdriver};Server=$SQLserver;Database=$SQLdata +base;UID=$SQLuser;PWD=$SQLpassword;Port=$SQLport", { PrintError => 0, RaiseError => 1, AutoCommit => $AutoCommit, FetchHashKeyName => 'NAME_lc' }, );
I would split that up, and construct the values separately to keep things somewhat understandable:
my $dsn = "dbi:ODBC:Driver={$ODBCdriver};Server=$SQLserver;Database=$S +QLdatabase,$SQLport;UID=$SQLuser;PWD=$SQLpassword; ..."; my $dbi_options = { PrintError => 0, RaiseError => 1, AutoCommit => $AutoCommit, FetchHashKeyName => 'NAME_lc' }; my $dbh = DBI->connect( $dsn, undef, undef, $dbi_options );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: dbi:ODBC change Port
by Anonymous Monk on Nov 10, 2022 at 10:12 UTC | |
by Corion (Patriarch) on Nov 10, 2022 at 10:27 UTC | |
by bliako (Abbot) on Nov 10, 2022 at 11:49 UTC |