Win32 ODBC Connect - Bad File Descriptor

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • enjoylife27
    New Member
    • Mar 2007
    • 1

    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($DS N) 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.
  • rickumali
    New Member
    • Dec 2006
    • 19

    #2
    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!

    Comment

    • miller
      Recognized Expert Top Contributor
      • Oct 2006
      • 1086

      #3
      Originally posted by rickumali
      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

      Comment

      • lordspace
        New Member
        • Nov 2006
        • 10

        #4
        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

        Comment

        Working...