Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2002-05-15
6
138 Views
Last Modified: 2013-12-25
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
Comment
Question by:pinskerj
  • 4
  • 2
6 Comments
 
LVL 10

Expert Comment

by:rj2
ID: 7015550
Is your .mdb file located under the wwwroot directory of the webserver? If not, try to move it there.
0
 

Author Comment

by:pinskerj
ID: 7017761
I will try this. Why would that even matter though? Thanks.
0
 

Author Comment

by:pinskerj
ID: 7017781
No this did not work at all. Sorry. Still no idea why I can't seem to run it as a CGI correctly.
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 10

Accepted Solution

by:
rj2 earned 500 total points
ID: 7018025
It matters because of access permissions. Did you both move the file and update the file location in the odbc config?
0
 

Author Comment

by:pinskerj
ID: 7018449
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
 

Author Comment

by:pinskerj
ID: 7018450
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

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction:   Welcome to my first article ever. To begin with, the reason I write this article.  I participated in a question on Experts Exchange about the start command in Windows and there were some discussion about the usage. The discussio…
If you get a (Blue Screen of Death), your system writes a small file called a minidump. Your first step is to make certain your computer is setup to record memory dumps. Right click My Computer, choose properties. Click on the advanced tab, an…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question