Hi Monks,
I have a script that inserts data into a MSSQL using Win32::ADO (dunno if it's relevant)
When run from the command-line it works fine.

The script, however, is used to be called from a cgi. When running the cgi (from the browser) I get "Can't call method "Close" on an undefined value at F:\Apps\Admin\scripts\post_submit.pl line 124."

What makes the script/database connection not to work when called from this cgi?

Note:
The cgi is a cgi that kicks-off the post_submit.pl script using Win32::Process in a separate shell, and immediately redirecting to a logmonitor.cgi, which tails the output of the post_submit.pl script and sends the tail output to the browser. The result is a non-cgi script that is started and not attached to the browser-session.

Oddly enough I have *cgi* scripts using the same database-techniques without a problem.

Need more info? I'd be happy to provide. :-)) Please help, since I'm in deeep trouble if I cannot solve this one..

edit (broquaint): dropped <code> tags and added formatting


In reply to Puzzled by web by john.goor

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.