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 BRError 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
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 BRError 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
RE: MS Access/CGI/Apache on WinNT questions
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 BRError 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 BRError: $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
RE: MS Access/CGI/Apache on WinNT questions
Jeff, In answer to your other questions: What version of DBD::ODBC are you using? PPMquery DBI DBI [1.201] Database independent interface for Perl Are you using MS-Access security? I am not using mdw files, if that is what you mean, but I do have the mdb file passworded. Does the web server user have access to the admin database? I believe so, unless Apache web server has a different user than my NT network login. I use a discarded low end NT machine for development. I am logged into the machine as myself when I (re)start Apache. Pete
RE: MS Access/CGI/Apache on WinNT questions
What version of DBD::ODBC are you using? What version of the Access driver are you using? When you copied to the local web server, what was the DSN you used? Thanks, Jeff -Original Message- From: MacGown, Peter [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 12, 2002 12:21 PM To: [EMAIL PROTECTED] Subject: RE: MS Access/CGI/Apache on WinNT questions 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 BRError 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 BRError: $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
RE: MS Access/CGI/Apache on WinNT questions
-Original Message- From: Jeff Urlwin [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 12, 2002 1:32 PM To: MacGown, Peter; [EMAIL PROTECTED] Subject: RE: MS Access/CGI/Apache on WinNT questions What version of DBD::ODBC are you using? PPM query ODBC DBD-ODBC [0.28] ODBC driver for the DBI module. When I do a verify, all the packages are up to date. What version of the Access driver are you using? 4.00.4202.00 The database is from MS Office, MS Access 97 When you copied to the local web server, what was the DSN you used? I tried two ways: d:\inetpub\wwwroot\Roster\roster03b.mdb and \\wilntws111\inetpub\wwwroot\Roster\roster03b.mdb where \\wilntws111 is the PC on the network, and \inetpub is a share on that machine. Thanks, Jeff -Original Message- From: MacGown, Peter [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 12, 2002 12:21 PM To: [EMAIL PROTECTED] Subject: RE: MS Access/CGI/Apache on WinNT questions 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 BRError 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 BRError: $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
RE: MS Access/CGI/Apache on WinNT questions
Peter, Did you escape the back-slashes? I.e. \\ instead of \? I will, tonight, upload a new DBI and DBD::ODBC for you which I'd like to see the output of trace. These will be PPD files, for use with PPM and that will get you up to the latest versions. Jeff -Original Message- From: MacGown, Peter [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 12, 2002 1:59 PM To: 'Jeff Urlwin'; [EMAIL PROTECTED] Subject: RE: MS Access/CGI/Apache on WinNT questions -Original Message- From: Jeff Urlwin [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 12, 2002 1:32 PM To: MacGown, Peter; [EMAIL PROTECTED] Subject: RE: MS Access/CGI/Apache on WinNT questions What version of DBD::ODBC are you using? PPM query ODBC DBD-ODBC [0.28] ODBC driver for the DBI module. When I do a verify, all the packages are up to date. What version of the Access driver are you using? 4.00.4202.00 The database is from MS Office, MS Access 97 When you copied to the local web server, what was the DSN you used? I tried two ways: d:\inetpub\wwwroot\Roster\roster03b.mdb and \\wilntws111\inetpub\wwwroot\Roster\roster03b.mdb where \\wilntws111 is the PC on the network, and \inetpub is a share on that machine. Thanks, Jeff -Original Message- From: MacGown, Peter [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 12, 2002 12:21 PM To: [EMAIL PROTECTED] Subject: RE: MS Access/CGI/Apache on WinNT questions 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 BRError 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 BRError: $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
RE: MS Access/CGI/Apache on WinNT questions
Jeff, I use notepad to modify the CGI scripts. I type in \\ so perl will interpret this as a single \. This works for the command line perl. I just can't get it to work on the web version. I won't be into work tomorrow, so won't be able to get the latest versions of DBI until Thursday. I was looking at Win32-ODBC, but I'd rather use DBI and DBD::ODBC because I will end up using it anyway. Thanks, Pete -Original Message- From: Jeff Urlwin [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 12, 2002 4:12 PM To: MacGown, Peter; 'Jeff Urlwin'; [EMAIL PROTECTED] Subject: RE: MS Access/CGI/Apache on WinNT questions Peter, Did you escape the back-slashes? I.e. \\ instead of \? I will, tonight, upload a new DBI and DBD::ODBC for you which I'd like to see the output of trace. These will be PPD files, for use with PPM and that will get you up to the latest versions. Jeff -Original Message- From: MacGown, Peter [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 12, 2002 1:59 PM To: 'Jeff Urlwin'; [EMAIL PROTECTED] Subject: RE: MS Access/CGI/Apache on WinNT questions -Original Message- From: Jeff Urlwin [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 12, 2002 1:32 PM To: MacGown, Peter; [EMAIL PROTECTED] Subject: RE: MS Access/CGI/Apache on WinNT questions What version of DBD::ODBC are you using? PPM query ODBC DBD-ODBC [0.28] ODBC driver for the DBI module. When I do a verify, all the packages are up to date. What version of the Access driver are you using? 4.00.4202.00 The database is from MS Office, MS Access 97 When you copied to the local web server, what was the DSN you used? I tried two ways: d:\inetpub\wwwroot\Roster\roster03b.mdb and \\wilntws111\inetpub\wwwroot\Roster\roster03b.mdb where \\wilntws111 is the PC on the network, and \inetpub is a share on that machine. Thanks, Jeff -Original Message- From: MacGown, Peter [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 12, 2002 12:21 PM To: [EMAIL PROTECTED] Subject: RE: MS Access/CGI/Apache on WinNT questions 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 BRError 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 BRError: $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
RE: MS Access/CGI/Apache on WinNT questions
Sounds good so far. Let's try these: from ppm, you should be able to: install ftp://ftp.esoftmatic.com/outgoing/DBI/DBI.ppd install ftp://ftp.esoftmatic.com/outgoing/DBI/DBD-ODBC.ppd If not, ftp to ftp::/ftp.esoftmatic.com/outgoing/DBI/ and download all the files into, say, c:\tmp and then install c:\tmp\DBI.ppd, etc Let me know if you have issues. Thanks, Jeff -Original Message- From: MacGown, Peter [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 12, 2002 5:11 PM To: 'Jeff Urlwin'; [EMAIL PROTECTED] Subject: RE: MS Access/CGI/Apache on WinNT questions Jeff, I use notepad to modify the CGI scripts. I type in \\ so perl will interpret this as a single \. This works for the command line perl. I just can't get it to work on the web version. I won't be into work tomorrow, so won't be able to get the latest versions of DBI until Thursday. I was looking at Win32-ODBC, but I'd rather use DBI and DBD::ODBC because I will end up using it anyway. Thanks, Pete -Original Message- From: Jeff Urlwin [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 12, 2002 4:12 PM To: MacGown, Peter; 'Jeff Urlwin'; [EMAIL PROTECTED] Subject: RE: MS Access/CGI/Apache on WinNT questions Peter, Did you escape the back-slashes? I.e. \\ instead of \? I will, tonight, upload a new DBI and DBD::ODBC for you which I'd like to see the output of trace. These will be PPD files, for use with PPM and that will get you up to the latest versions. Jeff -Original Message- From: MacGown, Peter [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 12, 2002 1:59 PM To: 'Jeff Urlwin'; [EMAIL PROTECTED] Subject: RE: MS Access/CGI/Apache on WinNT questions -Original Message- From: Jeff Urlwin [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 12, 2002 1:32 PM To: MacGown, Peter; [EMAIL PROTECTED] Subject: RE: MS Access/CGI/Apache on WinNT questions What version of DBD::ODBC are you using? PPM query ODBC DBD-ODBC [0.28] ODBC driver for the DBI module. When I do a verify, all the packages are up to date. What version of the Access driver are you using? 4.00.4202.00 The database is from MS Office, MS Access 97 When you copied to the local web server, what was the DSN you used? I tried two ways: d:\inetpub\wwwroot\Roster\roster03b.mdb and \\wilntws111\inetpub\wwwroot\Roster\roster03b.mdb where \\wilntws111 is the PC on the network, and \inetpub is a share on that machine. Thanks, Jeff -Original Message- From: MacGown, Peter [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 12, 2002 12:21 PM To: [EMAIL PROTECTED] Subject: RE: MS Access/CGI/Apache on WinNT questions 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 BRError 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 BRError: $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
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 BRError 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