• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 151
  • Last Modified:

Visual C++ cgi fails with exception error only when running as cgi

Hello,

I have written a custom Visual C++ cgi currently running under Apache in Windows 2000 that takes some form data and puts it into an access database. If I double click the executable file from the desktop and enter some data into it, it works fine. However, if the program is launched via the web server hit connecting to the database causes an unhandled exception error.

Does anyone have any experience with this? If so I can email you the visual C++ project. This is very frustrating as the program works fine but I wonder if when launched as a CGI from the web server maybe the program needs  to do something special to initialize the standard ODBC32.lib functions.

Thank you.

My direct email is pinskerj@satx.rr.com if you can answer this question.

Jordan Pinsker, MD
0
pinskerj
Asked:
pinskerj
  • 4
  • 2
1 Solution
 
rj2Commented:
Is your .mdb file located under the wwwroot directory of the webserver? If not, try to move it there.
0
 
pinskerjAuthor Commented:
I will try this. Why would that even matter though? Thanks.
0
 
pinskerjAuthor Commented:
No this did not work at all. Sorry. Still no idea why I can't seem to run it as a CGI correctly.
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
rj2Commented:
It matters because of access permissions. Did you both move the file and update the file location in the odbc config?
0
 
pinskerjAuthor Commented:
Yes, that did not help. However, I searched DejaNews for a long time and found the answer. Many people have had this problem with Apache. The trick is follow the following directions to make Apache run as a process not in the background, then everything works great:

I'm excited to announce that I solved the problem. I often started Apachefrom Start | Programs | Apache Web Server | Apache Server. That was theproblem. Now I go to MSDOS Prompt at c:\apache and type "apache" or just open the bin folder and double click it, then my script runs great...

Thanks for your help. I will accept your last comment as the answer.

Jordan
0
 
pinskerjAuthor Commented:
Although your solution did not work I added a comment with the actual solution I found in the newsgroups. Thank you for your help.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now