in reply to Re^3: dbi:ODBC change Port
in thread dbi:ODBC change Port

This is a good suggestion and makes the call more readable. I implemented it. However, it does not solve the issue. Calling:

my $dsn = "dbi:ODBC:Driver={$ODBCdriver};Server=$SQLserver,$SQLport;Da +tabase=$SQLdatabase;UID=$SQLuser;PWD=$SQLpassword; ...";

Note that I moved ',$SQLport' to Server. This syntax never connects. This is probably because it is not the syntax expected by Perl DBI (all examples on Perlmonks too also use '; Port=1433' which instead always connects no matter the port I use -> this indicates - I guess - that the parameter is not used. To be honest, I have no ideas.

Replies are listed 'Best First'.
Re^5: dbi:ODBC change Port
by Corion (Patriarch) on Nov 10, 2022 at 10:27 UTC

    The Perl DBI does not care about the contents of (the parameters part of) the DSN. This is between you and the ODBC driver, which is why I linked to https://connectionstrings.com.

    As none of the two approaches seem to work, I suggest you look closer at the ODBC driver and the version you have, and then find out what the proper connection string is.

Re^5: dbi:ODBC change Port
by bliako (Abbot) on Nov 10, 2022 at 11:49 UTC

    are the three dots part of your dsn?