See the DBI and ODBC docs for get_info (which maps to ODBC's SQLGetInfo,
which may help (and may not), but can't you tell by the DSN?

Regards,

Jeff

> Having established a connection to an ODBC database server with the
> following:
>       use DBI;
>       ...
>       my $dbh =
> DBI->connect("dbi:ODBC:DSN=dsnName;UID=usrName;PWD=usrPwd)
>
> is there anyway of knowing the database server from the $dbh handle?
>
> The need arose as I switch between a remote and a localhost server, and
> it would be more convenient if I could determine the active connection
> programmatically (which suggests some sort of method on $dbh which I am
> not aware of).
> Of course it is possible to do the equivalent by setting some flags at
> the outset, but didn't want to miss out if $dbh can provide a
> single-line solution.
>
>


Reply via email to