469,268 Members | 1,017 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,268 developers. It's quick & easy.

Win32 ODBC Connect - Bad File Descriptor

Hi there,

I am using Perl 5.8 with Apache 2.2 on Win XP SP2, all configured and working fine. I am able to run perl programs from command prompt. I am also able to call CGI scripts from HTML pages using Apache and it works fine.

The problem is with the database connectivity using WIN32::ODBC. Look at the following code:

my $DSN = "ABC";
my $connection = new Win32::ODBC($DSN) or die "Could not open connection to DSN because of [$!]";

It works perfectly fine from command prompt. I am even able to fire queries and display the results but the same code gives me "Bad File Descriptor" when run from the website (CGI script called from an HTML page).

Have tried so many things but could not get through this.

Kindly advise.
Mar 15 '07 #1
3 3420
I was "trying this out" for myself, looking up resources on the web, when I encountered this:

I Can Access DSN from Command Line, Not Web/CGI

Give this a try! Good luck!
Apr 1 '07 #2
miller
1,089 Expert 1GB
I was "trying this out" for myself, looking up resources on the web, when I encountered this:

I Can Access DSN from Command Line, Not Web/CGI

Give this a try! Good luck!
I have no experience with ODBC, but I took a look at Rick's link and it is very possibly exactly what you need. The page anchor doesn't appear to work, so just scroll down until you see the header that he's included.

- Miller
Apr 1 '07 #3
The previous link is very useful :)

You have to configure Data Source Name.

Start -> Control Panel -> Administrative Tools -> Data Sources (ODBC)
click on tab: ["System DSN"] Fill the Required Data
Apr 2 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by GitarJake | last post: by
12 posts views Thread by Remco Groot Beumer | last post: by
5 posts views Thread by Alec | last post: by
reply views Thread by sethi | last post: by
1 post views Thread by PLS | last post: by
2 posts views Thread by bcbrock | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.