Hi Jeff:

This is a snippet of the code:

        use DBI;

        my $dsn = "driver=Microsoft Access Driver
(*.mdb);dbq=\\\\nrent01\\fssdata\\Roster03b.mdb";

        DBI->trace(5, "c:/trace.txt");

        my $dbh = DBI->connect("DBI:ODBC:$dsn","admin","xyzzy") ||
                print "<BR>Error Opening Database: $DBI::errstr\n";
        
        my $sth = $dbh->prepare("SELECT [LNAME], [FNAME], [MI] FROM
T_EMPLOYEES") ||
                print "Error in Prepare:  $DBI::errstr\n";

        $sth->execute() ||
                print "<BR>Error:  $DBI::errstr\n";

}
This is what I get:

    DBI 1.201-nothread dispatch trace level set to 5
    -> DBI->connect(DBI:ODBC:driver=Microsoft Access Driver
(*.mdb);dbq=\\nrent01\fssdata\Roster03b.mdb, admin, ****)
    -> DBI->install_driver(ODBC) for MSWin32 perl=5.006001 pid=135 ruid=0
euid=0
       install_driver: DBD::ODBC version 0.28 loaded from
d:/Perl/site/lib/DBD/ODBC.pm
    New DBI::dr (for DBD::ODBC::dr, parent=, id=)
    dbih_setup_handle(DBI::dr=HASH(0x1a31908)=>DBI::dr=HASH(0x191aa94),
DBD::ODBC::dr, 0, Null!)
    dbih_make_com(Null!, DBD::ODBC::dr, 92)
    dbih_setup_attrib(DBI::dr=HASH(0x191aa94), Err, Null!) SCALAR(0x1b79f18)
(already defined)
    dbih_setup_attrib(DBI::dr=HASH(0x191aa94), State, Null!)
SCALAR(0x1b79f60) (already defined)
    dbih_setup_attrib(DBI::dr=HASH(0x191aa94), Errstr, Null!)
SCALAR(0x1b79f3c) (already defined)
    dbih_setup_attrib(DBI::dr=HASH(0x191aa94), Handlers, Null!)
ARRAY(0x191aa10) (already defined)
    dbih_setup_attrib(DBI::dr=HASH(0x191aa94), Debug, Null!) 0 (already
defined)
    dbih_setup_attrib(DBI::dr=HASH(0x191aa94), FetchHashKeyName, Null!)
'NAME' (already defined)
    <- install_driver= DBI::dr=HASH(0x1a31908)
    -> connect for DBD::ODBC::dr (DBI::dr=HASH(0x1a31908)~0x191aa94
'driver=Microsoft Access Driver (*.mdb);dbq=\\nrent01\fssdata\Roster03b.mdb'
'admin' **** HASH(0x191ef94))

Also, I get a Dr. Watson on the NT machine saying Perl.exe choked.

Any suggestions?

Thanks,
Pete 

-----Original Message-----
From: Jeff Urlwin [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 12, 2002 11:35 AM
To: MacGown, Peter; [EMAIL PROTECTED]
Subject: RE: MS Access/CGI/Apache on WinNT questions


Pete,

Right before the connect, do the following:

        DBI->trace(5, "c:/trace.txt");

Then, send me the trace.txt from the web server's C: drive.  (and, look at
it yourself to see if the error is recognizable).

Some other questions...
What version of DBD::ODBC are you using?
Are you using MS-Access security?
Does the web server user have access to the admin database?

Regards,

Jeff

> -----Original Message-----
> From: MacGown, Peter [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, March 12, 2002 10:05 AM
> To: [EMAIL PROTECTED]
> Subject: RE: MS Access/CGI/Apache on WinNT questions
>
>
> Jeff,
> You are correct that it does work from the command line.  The share name
> "fssdata" share is accessible to me, but just to verify that
> something funky
> isn't going on, I copied the mdb file over to the web server and tried to
> run it from there.  I still got the same message.
> As a newbie to perl and apache, I took on a task of trying to set up a web
> application to cut my teeth.  The existing application has proven all too
> successful and the user population has outgrown MS Access.  An
> Oracle server
> is in the works, but until then, I need to get it up and running using MS
> Access.
> I Know that this question is perl-101, but, given my inexperience
> with perl,
> what do you mean by "...set a trace file and set the DBI tracing level to
> 4..."?
> Thanks,
> Pete MacGown
>
> -----Original Message-----
> From: Jeff Urlwin [mailto:[EMAIL PROTECTED]]
> Sent: Monday, March 11, 2002 9:22 PM
> To: MacGown, Peter; [EMAIL PROTECTED]
> Subject: RE: MS Access/CGI/Apache on WinNT questions
>
>
> That, unfortunately, can be a bad message because of the way that
> DBD::ODBC
> handles opening the database.  What's happening is that DBI can't open the
> database using the "DSN-less" style open (SQLDriverConnect) which
> fails and
> then tries to call SQLConnect, which expects a 32? character or
> less DSN.  I
> hope to make this better in the future...
>
> In the mean time, I'm going to guess that this may work from the command
> line and not from the CGI.  If that's not the case, this may or may not
> apply.
>       Check the share name "fssdata" and ensure it's accessible from the
> username
> starting the web service (make sure the web server is not being started as
> local system, either, as that will have NO access to the network).
>
> IF that doesn't work, set a trace file and set the DBI tracing level to 4
> (or above) and post it back here.
>
> Jeff
>
> >
> > Hi,
> > I hope other people have been successful at getting CGI scripts
> > running that
> > access MS Access because I haven't.  Here is a snippet of code that I am
> > trying to get to work:
> >
> > #!d:/perl/bin/perl -wT
> >
> > use DBI;
> >
> > my $dsn = "driver=Microsoft Access Driver
> > (*.mdb);dbq=\\\\nrent01\\fssdata\\Roster03b.mdb";
> > my $dbh = DBI->connect("DBI:ODBC:$dsn","admin","xyzzy") ||
> >     print "<BR>Error Opening Database: $DBI::errstr\n";
> >
> > But I get this message:
> >
> > Error Opening Database: [Microsoft][ODBC Driver Manager]
> Invalid string or
> > buffer length (SQL-S1090)(DBD: db_login/SQLConnect err=-1)
> >
> > Am I doing something amazingly stupid and just can't see it?  Is there a
> > better way to get to an MS Access database?
> >
> > Please help!
> >
> > Thanks,
> > Pete MacGown
> >
> >
>
>
>


Reply via email to