in reply to Perl DBI Question
This should help you, just check return code from connect(): (Tested and worked, I have web, but not weeb)
use DBI; use strict; use warnings; my $dbi; my @databases = ('dbi:ODBC:weeb', 'dbi:ODBC:web'); for (@databases) { print "attempt connect to database $_\n"; if ($dbi = DBI->connect($_,"","",{AutoCommit=>1})) { print "connected to database $_\n"; last; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Perl DBI Question
by hmerrill (Friar) on Jan 21, 2004 at 21:56 UTC |