djibel

I'm surprised no-one has mentioned it, but here goes: It appears that you've misattributed the error to CGI because you changed too many variables between your "it worked" test and your "it didn't work" test. You changed two variables: (1) whether or not you used CGI, and (2) the account you ran the program under. (You probably changed others, as well, such as running it under a web server, etc., but those are the two that are important for this example.)

You can run the program without CGI under your own account, in which case you should have seen the proper data come out. Alternatively, you could have run it under the web server account in a command-line window to see it fail to retrieve the data of interest. So remember, when you're isolating a problem, make sure you've limited the changes to a single variable before deciding on the culprit. It's far too easy to make the assumption that everything else is the same, when in fact it's not.

...roboticus

Programmer A: Hmmm ... this program ran just fine last week, but now it's giving me an error message!

Programmer B: OK, what changed?

Programmer A: Nothing!

Programmer B: Nonsense, something had to change!

Programmer A: No, really, nothing changed!

Programmer B: OK, then since you ran the program last week, why did you it today? If you changed nothing, you'll get the same answer.

Programmer A: Oh, ummm, err.... OK, the data changed.

Programmer B: OK, then that changed. What happens when you run the program with the same data?

Programmer A: I tried that a few minutes ago, and it gave me the same error message.

Programmer B: OK, then, what else changed?

Programmer A: Nothing!

Programmer B: rolls eyes...


In reply to Debugging tip: Change only one thing at a time (was Re: CGI and ODBC (progress)) by roboticus
in thread CGI and ODBC (progress) by djibel

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.