I received the same error, when path to *.mdb file was not correct.

...
my $dbq    = 'C:\bin\games\TkSokoban\DB\Sokobanxxx.mdb';
...

resulted in error:

DBI->connect(DRIVER=Microsoft Access Driver
(*.mdb);DBQ=C:\bin\games\TkSokoban\DB\Sokobanxxx.mdb) failed:
[Microsoft][ODBC Driver Manager] Invalid string or buffer length
(SQL-S1090)(DBD: db_login/SQLConnect err=-1) at test.pl line 7
connect() failed: [Microsoft][ODBC Driver Manager] Invalid string or buffer
length (SQL-S1090)(DBD: db_login/SQLConnect err=-1) at test.pl line 8.

MaT

> -----Original Message-----
> From: Etienne Marcotte [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, October 23, 2001 8:55 PM
> To: Jan Matejka
> Cc: [EMAIL PROTECTED]
> Subject: Re: Problem connecting to Access DB
>
>
> Still gives the exact same error..
>
> I have DBI v 1.02 that's maybe the big problem
>
> I will try to install v1.20 but I have no clue how to install
> modules with
> nmake and all. I think I should switch to Activestates perl
> instead of my
> actual perl.
>
> Etienne
>
> Jan Matejka wrote:
>
> > It works OK even without creating a DSN with ODBC manager.
> >
> > Complete working example - Access 2000 without any System.mdb,
> > Perl 5.6.1 build 629, DBI 1.20, DBD-ODBC 0.28
> >
> > #-------------------------------------------------------
> > use DBI;
> >
> > my $dbq    = 'C:\bin\games\TkSokoban\DB\Sokoban.mdb';
> > my $driver  = 'Microsoft Access Driver (*.mdb)';
> > my $dsn    = "DRIVER=$driver;DBQ=$dbq";
> >
> > # Username and Password are not specified: no System.mdb is used
> > my $dbh    = DBI->connect ("dbi:ODBC:$dsn", undef, undef);
> > die ("connect() failed: ".$DBI::errstr) unless ($dbh);
> >
> > print STDERR 'Using DBI v',$DBI::VERSION,',
> ',$dbh->{Driver}->{Name}, '
> > driver v',$dbh->{Driver}->{Version},"\n";
> >
> > $sel=$dbh->prepare(<<'eof');
> >    SELECT
> >       ParamName, ParamValue
> >    FROM
> >       Config
> > eof
> >
> > $sel->execute();
> >
> > while (@data=$sel->fetchrow_array()) {
> >    print "@data\n";
> > }
> >
> > #-------------------------------------------------------
> >
> > MaT
> >
> > > -----Original Message-----
> > > From: Etienne Marcotte [mailto:[EMAIL PROTECTED]]
> > > Sent: Tuesday, October 23, 2001 6:30 PM
> > > To: Bart Lateur
> > > Cc: [EMAIL PROTECTED]
> > > Subject: Re: Problem connecting to Access DB
> > >
> > >
> > > It works fine with a system DSN,
> > >
> > > But when a user renames the database, you have to recreate a
> > > DSN each time.
> > >
> > > Is there any way to create a DNS without the database
> > > name/path and then
> > > specify it from the perl script in the connect string ?
> > >
> > > Etienne
> > >
> > > Bart Lateur wrote:
> > >
> > > > On Tue, 23 Oct 2001 10:55:57 -0400, Etienne Marcotte wrote:
> > > >
> > > > >I made an access DB, created an ODBC DNS with windows
> 2000 utility
> > > > >(altough I'm not sure I did everything correctly)
> > > > >
> > > > >When I try the connect string:
> > > > >
> > > > >dbi:ODBC:driver=Microsoft Access Driver
> (*.mdb);dbq=c:\\clients.mdb
> > > >
> > > > Just a thought: why aren't you simply creating a (system)
> > > DSN with the
> > > > ODBC Contol Panel, and simply reference that by name? The
> > > connect string
> > > > then can simply be
> > > >
> > > >         DBI:ODBC:yourDSN
> > > >
> > > > --
> > > >         Bart.
> > >
>

Reply via email to