RE: ODBC

2004-09-03 Thread Ron Goral


 -Original Message-
 From: Wiggins d Anconia [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, September 01, 2004 8:33 AM
 To: Rearick, Kenneth N.; '[EMAIL PROTECTED]'
 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


CGI::Carp may not capture errors that occur in the DBI module. However, DBI
has a built in logging functionality called trace which allows you to
specify the level of detail you want to see as well as specify where you
want the trace output stored.  Note that trace will log everything that is
being done in the name of DBI, so be prepared to wade through alot of info.
Though I would recommend reading the entire documentation, atleast go to
this address and check out this function:

http://search.cpan.org/~timb/DBI-1.43/DBI.pm#TRACING

HTH,
Peace in Christ -
Ron Goral



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




RE: ODBC

2004-09-03 Thread Rearick, Kenneth N.
Thanks for the help. It turned out to be a setup problem with ODBC the DNS was in the 
user area not the system. But the information on tracing errors help identify where 
the problem was located. 

-Original Message-
From: Ron Goral [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 03, 2004 6:35 AM
To: Rearick, Kenneth N.; [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: ODBC



 -Original Message-
 From: Wiggins d Anconia [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, September 01, 2004 8:33 AM
 To: Rearick, Kenneth N.; '[EMAIL PROTECTED]'
 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


CGI::Carp may not capture errors that occur in the DBI module. However, DBI
has a built in logging functionality called trace which allows you to
specify the level of detail you want to see as well as specify where you
want the trace output stored.  Note that trace will log everything that is
being done in the name of DBI, so be prepared to wade through alot of info.
Though I would recommend reading the entire documentation, atleast go to
this address and check out this function:

http://search.cpan.org/~timb/DBI-1.43/DBI.pm#TRACING

HTH,
Peace in Christ -
Ron Goral


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: ODBC

2004-09-01 Thread Sean Davis
On Aug 31, 2004, at 4:15 PM, Rearick, Kenneth N. wrote:
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?
$dbh = DBI-connect(DBI:ODBC:$SERVER, $USER, $PASSWORD);
You can put catch errors like:
use CGI::Carp qw(fatalsToBrowser);
$dbh = DBI-connect(DBI:ODBC:$SERVER, $USER, $PASSWORD) ||
   croak Database connection failed: $DBI::errstr;
More generally, getting to know your server log is very important.  I'm 
not sure where it is, but on *nix it is typically called error_log and 
is in the httpd directory (which could be in different places).

Sean
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response



Re: ODBC

2004-09-01 Thread Wiggins d Anconia
 
 
 
 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response