I'd certainly use -w:
     Note: perl is running without the recommended perl -w option

There appears to be a bit missing from your trace. It should show
something like:

"Driver connect 'DSN=test;uid=Martin_Evans;pwd=easysoft;', '', 'xxxx'"

after

    dbih_setup_attrib(DBI::db=HASH(0x8248c00), HandleError,
        DBI::dr=HASH(0x81b08 44)) undef (not defined)
    the last line of your log file.

The 1.0.6 code has this print as:

if (DBIc_DEBUGIV(imp_dbh) >= 8)
 PerlIO_printf(DBIc_LOGPIO(imp_dbh), "Driver connect '%s',
 '%s', '%s'\n", dbname, uid, pwd);

and it is not appearing in your log.

BTW I only pointed out you can used "dbi:ODBC:DSN=x;UID=y;PWD=z;" because
you were mentioning the dsn not found and no default data source message.
Does the plain old DBI->connect('dbi:ODBC:fred', 'user', 'pass') work?

Martin
--
Martin J. Evans
Easysoft Ltd, UK
Development

On 22-Feb-2005 Walter Obermiller wrote:
> Martin,
> 
> thanks for your patience.
> 
> Martin J. Evans wrote:
>> On 22-Feb-2005 Walter Obermiller wrote:
>> 
>>>Martin,
>>>
>>>
>>>
>>>Martin J. Evans wrote:
>>>
>>>>The DontDlClose was a suggestion to stop the seg faulting on exit.
>>>>
>>>>When I said you can use DSN=emanuel-sbart;UID=*;PWD=*; I did of course mean
>>>>to
>>>>say you need to keep the 'dbi:ODBC' on the front. i.e.
>>>>
>>>>'dbi:ODBC:DSN=emanuel-sbart;UID=*;PWD=*;'
>>>
>>>blush :-)
>>>
>>>I have fixed that now.
>> 
>> 
>> You haven't actually shown your DBI->connect now. With DBD::ODBC 1.13 if I
>> do:
> 
> here's what I do, and I think it is consistent with what you suggested:
> 
>    my $dbh
>        = DBI->connect('dbi:ODBC:DSN=emanuel-sbart;UID=**;PWD=**;')
>              || die "can't connect to $data_source: $DBI::errstr";
>        $rc = $dbh->disconnect;
>    exit();
> 
> 
>> 
>> perl -e 'use DBI;my $dbh =
>> DBI->connect("dbi:ODBC:DSN=test;UID=Martin_Evans;PWD=easysoft;");'
>> omitting the username/password arguments
>> 
>> OR
>> 
>> perl -e 'use DBI;my $dbh =
>> DBI->connect("dbi:ODBC:DSN=test;UID=Martin_Evans;PWD=easysoft;","","");'
>> specifying empty username/password arguments
>> 
>> it works fine:
>> 
>> Str In = [DSN=test;UID=Martin_Evans;PWD=********;][length = 39] 
>> 
>> Looking at the code in DBD::ODBC it just passes the string straight through
>> if
>> it finds a DSN/UID/PWD. I compared DBD::ODBC 1.13 and 1.06 and I can't see
>> this
>> has changed but you never know. Running with:
>> 
>> DBI_TRACE=8=dbitrace.log perl myscript.pl
> 
> Thats what the tracefile looks like:
> 
>   DBI 1.43-ithread default trace level set to 0x0/8 (pid 26246)
>      Note: perl is running without the recommended perl -w option
>      -> DBI->connect(dbi:ODBC:DSN=emanuel-sbart;UID=walter;PWD=foo;, , ****)
>      -> DBI->install_driver(ODBC) for linux perl=5.008005 pid=26246 
> ruid=100 euid=100
>         install_driver: DBD::ODBC version 1.06 loaded from 
> /usr/lib/perl5/vendor_perl/5.8.5/i586-linux-thread-multi/DBD/ODBC.pm
>      New DBI::dr (for DBD::ODBC::dr, parent=, id=)
>      dbih_setup_handle(DBI::dr=HASH(0x8251c10)=>DBI::dr=HASH(0x82ce1a0), 
> DBD::ODBC::dr, 0, Null!)
>      dbih_make_com(Null!, 0, DBD::ODBC::dr, 92, 0) thr#8151008
>      dbih_setup_attrib(DBI::dr=HASH(0x82ce1a0), Err, Null!) 
> SCALAR(0x820c66c) (already defined)
>      dbih_setup_attrib(DBI::dr=HASH(0x82ce1a0), State, Null!) 
> SCALAR(0x82b2520) (already defined)
>      dbih_setup_attrib(DBI::dr=HASH(0x82ce1a0), Errstr, Null!) 
> SCALAR(0x82b24fc) (already defined)
>      dbih_setup_attrib(DBI::dr=HASH(0x82ce1a0), TraceLevel, Null!) 0 
> (already defined)
>      dbih_setup_attrib(DBI::dr=HASH(0x82ce1a0), FetchHashKeyName, Null!) 
> 'NAME' (already defined)
>      <- install_driver= DBI::dr=HASH(0x8251c10)
>      !! warn: 0 CLEARED by call to default_user method
>      -> default_user in DBD::_::dr for DBD::ODBC::dr 
> (DBI::dr=HASH(0x8251c10)~0x82ce1a0 undef undef HASH(0x821d77c)) thr#8151008
>      <- default_user= ( undef undef ) [2 items] at 
> /usr/lib/perl5/vendor_perl/5.8.5/i586-linux-thread-multi/DBI.pm line 577 
> via odbc-emanuel-test.pl line 17
>      -> connect for DBD::ODBC::dr (DBI::dr=HASH(0x8251c10)~0x82ce1a0 
> 'DSN=emanuel-sbart;UID=**;PWD=**;' undef **** HASH(0x82cf4d0)) thr#8151008
>      New DBI::db (for DBD::ODBC::db, parent=DBI::dr=HASH(0x82ce1a0), id=)
>      dbih_setup_handle(DBI::db=HASH(0x82ce164)=>DBI::db=HASH(0x82cf4c4), 
> DBD::ODBC::db, 824edf8, Null!)
>      dbih_make_com(DBI::dr=HASH(0x82ce1a0), 82b5ce0, DBD::ODBC::db, 220, 
> 0) thr#8151008
>      dbih_setup_attrib(DBI::db=HASH(0x82cf4c4), Err, 
> DBI::dr=HASH(0x82ce1a0)) SCALAR(0x8256234) (already defined)
>      dbih_setup_attrib(DBI::db=HASH(0x82cf4c4), State, 
> DBI::dr=HASH(0x82ce1a0)) SCALAR(0x8256294) (already defined)
>      dbih_setup_attrib(DBI::db=HASH(0x82cf4c4), Errstr, 
> DBI::dr=HASH(0x82ce1a0)) SCALAR(0x8256264) (already defined)
>      dbih_setup_attrib(DBI::db=HASH(0x82cf4c4), TraceLevel, 
> DBI::dr=HASH(0x82ce1a0)) 0 (already defined)
>      dbih_setup_attrib(DBI::db=HASH(0x82cf4c4), FetchHashKeyName, 
> DBI::dr=HASH(0x82ce1a0)) 'NAME' (already defined)
>      dbih_setup_attrib(DBI::db=HASH(0x82cf4c4), HandleSetErr, 
> DBI::dr=HASH(0x82ce1a0)) undef (not defined)
>      dbih_setup_attrib(DBI::db=HASH(0x82cf4c4), HandleError, 
> DBI::dr=HASH(0x82ce1a0)) undef (not defined)
> -------------
> 
> 
> 
> 
>> will provide a trace which should show what DBD::ODBC is using.
>> 
>> I'd still like to see your DBI->connect call though.
> 
> Thanks,
> 
>       -walt

<snipped previous history - getting too long for me>

Reply via email to