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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |