Home > Archive > PERL CGI Beginners > September 2004 > Which interface should I be using for Database Access?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Which interface should I be using for Database Access?
|
|
| Siegfried Heintze 2004-09-02, 8:55 am |
| Wow! This is news to me! I've been using Win32::ODBC and was very worried
about portability. Now I try perldoc and cannot find anything about using
DBI with ODBC. However, I search CPAN and I find this:
"3.3 Is DBI supported under Windows 95 / NT platforms?
Finally, yes! Jeff Urlwin has been working diligently on building DBI and
DBD::ODBC under these platforms, and, with the advent of a stabler perl and
a port of MakeMaker, the project has come on by great leaps and bounds.
The DBI and DBD::Oracle Win32 ports are now a standard part of DBI, so,
downloading DBI of version higher than 0.81 should work fine as should using
the most recent DBD::Oracle version."
This is GREAT! But being a beginner, I don't know what to do next. Do I
download the source? Is there a PPM module? Where can I find an example that
accesses Microsoft Access?
Thanks,
Siegfried
-----Original Message-----
From: Wiggins d Anconia [mailto:wiggins@danconia.org]
Sent: Wednesday, September 01, 2004 7:33 AM
To: Rearick, Kenneth N.; 'beginners-cgi@perl.org'
Subject: Re: ODBC
>
>
>
> I have a CGI program in which I am trying to access a database. When I
run the code in active state feeding it the input from the form it runs
fine. When I try to run it as a cgi from IE using apache web server the
data from the form comes in fine but it can not seem to attach to the
database.
>
> Is there anyway to see the errors that the DBI:ODBC is generating when
the application is being run from the server? Any ideas why the ODBC
connect is failing?
>
You can use CGI::Carp and 'fatalsToBrowser' to have fatal messages
thrown to the browser, alternatively error messages are generally sent
to the apache error log. Check there for what they have to say. You
could also turn off DBI's automatic exceptions and catch them yourself,
but this is a fair amount more work (at least while prototyping).
> $dbh = DBI->connect("DBI:ODBC:$SERVER", $USER, $PASSWORD);
>
>
Sorry can't help with the connect issue, I suspect if you can find the
error output it will. If not you might try the dbi-users group or maybe
someone else with ODBC experience will chime in.
http://danconia.org
--
To unsubscribe, e-mail: beginners-cgi-unsubscribe@perl.org
For additional commands, e-mail: beginners-cgi-help@perl.org
<http://learn.perl.org/> <http://learn.perl.org/first-response>
| |
| Brian Spindler 2004-09-02, 8:55 pm |
| The benefit of DBD::ODBC is that you do not have to do "database
specific" querying so to speak. You would setup an ODBC connection
(Control Panel->ODBC Administrator) to your Access database, then use
the DSN name you created to access the access database. Do a `perldoc
DBD::ODBC` to get any documentation you may need on how to connect to
your DSN and manipulate the database.
-Brian =
-----Original Message-----
From: Siegfried Heintze [mailto:siegfried@heintze.com] =
Sent: Wednesday, September 01, 2004 11:17 AM
To: beginners-cgi@perl.org
Subject: Which interface should I be using for Database Access?
Wow! This is news to me! I've been using Win32::ODBC and was very
worried about portability. Now I try perldoc and cannot find anything
about using DBI with ODBC. However, I search CPAN and I find this:
"3.3 Is DBI supported under Windows 95 / NT platforms?
Finally, yes! Jeff Urlwin has been working diligently on building DBI
and DBD::ODBC under these platforms, and, with the advent of a stabler
perl and a port of MakeMaker, the project has come on by great leaps and
bounds.
The DBI and DBD::Oracle Win32 ports are now a standard part of DBI, so,
downloading DBI of version higher than 0.81 should work fine as should
using the most recent DBD::Oracle version."
This is GREAT! But being a beginner, I don't know what to do next. Do I
download the source? Is there a PPM module? Where can I find an example
that accesses Microsoft Access?
Thanks,
Siegfried
-----Original Message-----
From: Wiggins d Anconia [mailto:wiggins@danconia.org]
Sent: Wednesday, September 01, 2004 7:33 AM
To: Rearick, Kenneth N.; 'beginners-cgi@perl.org'
Subject: Re: ODBC
> =
> =
> =
> I have a CGI program in which I am trying to access a database. When I
run the code in active state feeding it the input from the form it runs
fine. When I try to run it as a cgi from IE using apache web server the
data from the form comes in fine but it can not seem to attach to the
database.
> =
> Is there anyway to see the errors that the DBI:ODBC is generating when
the application is being run from the server? Any ideas why the ODBC
connect is failing?
>
You can use CGI::Carp and 'fatalsToBrowser' to have fatal messages
thrown to the browser, alternatively error messages are generally sent
to the apache error log. Check there for what they have to say. You
could also turn off DBI's automatic exceptions and catch them yourself,
but this is a fair amount more work (at least while prototyping).
=
> $dbh =3D DBI->connect("DBI:ODBC:$SERVER", $USER, $PASSWORD);
> =
> =
Sorry can't help with the connect issue, I suspect if you can find the
error output it will. If not you might try the dbi-users group or maybe
someone else with ODBC experience will chime in.
http://danconia.org
--
To unsubscribe, e-mail: beginners-cgi-unsubscribe@perl.org
For additional commands, e-mail: beginners-cgi-help@perl.org
<http://learn.perl.org/> <http://learn.perl.org/first-response>
-- =
To unsubscribe, e-mail: beginners-cgi-unsubscribe@perl.org
For additional commands, e-mail: beginners-cgi-help@perl.org
<http://learn.perl.org/> <http://learn.perl.org/first-response>
****************************************
*******************************
This e-mail and any files transmitted with it are confidential and are
intended solely for the use of the individual or entity to whom they are
addressed. The views, opinions, and information expressed in this message
represents those of the individual sender and do not reflect the views of
Ruesch International, Inc. Take notice that the employees and/or agents of
Ruesch International are not authorized to make corporate commitments or
representations via e-mail and no statement or representation made in this
e-mail is binding upon Ruesch International. Ruesch cannot guarantee the
integrity or the confidentiality of any incoming or outgoing e-mail
communication.
****************************************
*******************************
| |
| William McKee 2004-09-02, 8:55 pm |
| On Wed, Sep 01, 2004 at 09:16:53AM -0600, Siegfried Heintze wrote:
> This is GREAT! But being a beginner, I don't know what to do next. Do I
> download the source? Is there a PPM module? Where can I find an example that
> accesses Microsoft Access?
Hi Siegfried,
I believe that there is a PPM for DBI and DBD::ODBC. Fire up ppm3 and
see for yourself. I have an old code sample (ergo, not the best form but
it works) which I will send to you offlist.
Good luck,
William
--
Knowmad Services Inc.
http://www.knowmad.com
|
|
|
|
|