Simon, I tried this test.

I can connect successfully to the database with your test code. But,
attempting to print the ConnectionString only yields this error message,

Can't get DBI::db=HASH(0xbb1a1c)->{ConnectionString}: unrecognised attribute
at
C:/Perl/site/lib/DBD/ADO.pm line 311.

Ron

-----Original Message-----
From: Simon Oliver [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 12, 2001 4:54 AM
To: [EMAIL PROTECTED]
Cc: Bart Lateur; Dbi-Users
Subject: Re: DSN vs. DSNless connection


Here's a test that can help identify what connection settings to use:

Create a working system DSN.

Then connect to the DSN using ADO and examine the Connection String:

use warnings;
use strict;
use DBI;

my ($dsn, $uid, $pwd) = @ARGV;

my ($p) = $0 =~ m/[\\\/]?([^\\\/]+$)/;

if (!defined $dsn || $dsn =~ /^-h/) {
        die "Usage: $p dsn [uid] [pwd]\n",
                "\t'dsn' can be a DSN or connection string.\n";
}

my $dbh = DBI->connect("dbi:ADO:$dsn", $uid, $pwd)
  or die "Error connecting to '$dsn' as '$uid'.\n";

print $dbh->{ConnectionString};

exit;

Reply via email to