Re: CGI and Environment Variables
- Posted by GeorgeWalters Jul 28, 2009
- 1717 views
Hi George,
I didn't use ODBC as to tell you exactly if this will solve your problem, but I found the following post interesting in the forum thread you posted:
"Did you set up your "apache" ODBC datasource as a System DSN, so that Apache can find it?
A User DSN or File DSN is only available to you when you use an interactive program.
A System DSN is available to other processes - like Apache running as a Windows service."
And well, a quick search about how to do this: http://www.stylusstudio.com/docs/v2007/d_rdb20.html or http://www.webwizguide.com/kb/ASP_tutorials/setting_up_dsn.asp
Hope this helps,
Guillermo
Well, Thank You. It did help and happened to solve the problem. I also read that and had previously set up the DSN as a system DSN, tested it on the setup panel but stupid me did not click the OK button. Your message made me check it again and it was not there so I set it up again, tested, and made sure I clicked the OK button. Then launching an EU program from a html document worked. So Thanks for reminding me.
SO I have learned 2 important things from this 2 weeks of agony.
1. I have learned a lot from comments from those who know far more than I do and I am thankful for their help.
2. You cannot use getenv to retrieve your 'user environmental vars' that worked outside of apache and CGI programs. You must hard code them or setup them up in a txt file in the CGI directory. I suspect now looking at start >> control panel >> system >> advanced >> environmental panel where there are 2 sections, 'user environmental vars' and 'system environmental vars', that if I set the vars up under 'system environmental vars' they may be accessable from CGI programs. I'll check this and make a later post.
2. 'User DSN' setup does not work to access a database, you need to set up a 'System DSN'. I don't understand this but it solves the problem.