> 
> Yup that did the trick.
> 
> I found this blurb about odbc_version, but I implemented it 
> incorrectly when I tried it before...  maybe this will help 
> somebody in the future.
> 
> i.e.
> 
> I had a connection similar to this:
> 
> my $cs = 
> "Transport=tcpip;Driver=OOB;Server=10.0.0.99;Port=8888;TargetD
> SN=user;UID=$navlogin;PWD=$navpass;";
> my $nh = DBI->connect("DBI:ODBC:$cs", { odbc_version => 2 }) 
> or die("Navision is unavailable\n");
> 
> That didn't work.
> Looking at the debug stuff, I realized it was trying to set 
> the password with that { odbc_version => 2 } part of the connection...
> 
> So, the way that works looks like this (ends up using a DSN, oh well):
> 
> my $nh = DBI->connect("DBI:ODBC:DSN=navision;", "$navlogin", 
> "$navpass", { odbc_version => 2}) or die("Navision is unavailable\n");

FYI, I've added this to the documentation, indicating that this works.
However, the problem with your original attempt was that you didn't specific
an undef user id and password for the call to connect.  Either of these
should work:

my $cs =
"Transport=tcpip;Driver=OOB;Server=10.0.0.99;Port=8888;TargetDSN=user";
my $login="UID=$navlogin;PWD=$navpass;";

my $dbh = DBI->connect("DBI:ODBC:$cs;$login",,, { odbc_version => 2 }) 
Or
my $dbh = DBI->connect("DBI:ODBC:$cs",$navlogin,$navpass, { odbc_version =>
2 }) 

Regards,

Jeff

> On Mon, 16 Jun 2003, Martin J. Evans wrote:
> 
> >Todd,
> >
> >>From the dbdimp.c source code it looks like you set the 
> odbc_version 
> >>attribute
> >of DBD::ODBC (at least in 1.05 it is).
> >
> >>From the docs:
> >
> >       odbc_version
> >           This was added prior to the move to ODBC 3.x to allow
> >           the caller to "force" ODBC 3.0 compatibility.  It's
> >           probably not as useful now, but it allowed get_info
> >           and get_type_info to return correct/updated
> >           information that ODBC 2.x didn't permit/provide.
> >
> >but as far as I can see if you set it to 2 it will call 
> SQLSetEnvAttr 
> >for ODBC 2.
> >
> >Martin
> >--
> >Martin J. Evans
> >Easysoft Ltd, UK
> >Development
> >
> >
> >On 16-Jun-2003 Todd Morrey wrote:
> >> I've been beating my head against my monitor trying to 
> figure out how 
> >> to force ODBC version 2.0 behavior instead of 3.0 in 
> DBD::ODBC.  I've 
> >> gone through the man pages, all the online docs that I can find, 
> >> searched through the archives of this mailing list...  I 
> guess it's 
> >> not a common tweak.
> >>
> >> Apparently my ODBC server doesn't support version 3 
> behavior.  This 
> >> is a proprietary database, Navision Financials using its C/ODBC 
> >> driver.  PHP ODBC is working, and through debugging the only 
> >> difference I can spot is that the PHP connections are 
> coming across 
> >> as an ODBC 2 connection.
> >>
> >> If anybody knows how to do this, I'd be psyched to hear about it.
> >>
> >> I am using Perl 5.8.0, DBI 1.30, and DBD::ODBC 1.05.
> >>
> >> Thanks,
> >> Todd
> >
> 


Reply via email to