Bluehost.com Web Hosting $6.95

Connecting to a database (Oracle) through Apache using CGI

This is a discussion on Connecting to a database (Oracle) through Apache using CGI within the Windows Web Servers forums, part of the Web Server and Related Forums category; Hello, I am trying to connect to an Oracle database using CGI/C++ (with Visual C++). Once my .exe generated, ...


Go Back   Usenet Forums > Web Server and Related Forums > Windows Web Servers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-08-2004
Xavier
 
Posts: n/a
Default Connecting to a database (Oracle) through Apache using CGI

Hello,

I am trying to connect to an Oracle database using CGI/C++ (with
Visual C++).

Once my .exe generated, it works fine when I execute it directly.
But when I use Apache and executes the .exe as a cgi, it does not
work. I get an error message saying that "The memory cannot be read".
I have tried 2 ways to connect to the database (ODBC, Pro*C/C++): for
both, it works when executing directly but does not work through the
Web Server.

What I can also say is that the WebServer works well when executing
cgi that do not need access to a database (so it is well configured).
I also think that it would have the same behavior with another
database.

Is there a specific config of Apache in order to connect to a database
?
I really don't know what could be missing.

Any help would be welcome.
Thanks in advance.

Xavier

Here is the code I use:

int main()
{
cout << "Content-type: text/html\n\n";
cout << "<html>\n<body>\n";

Database* db;

try
{
db = new Database((char*)oracle_user.data(),
(char*)oracle_pwd.data(),(char*)oracle_sid.data()) ;
cout << "Connection OK" << endl;
} catch (...) {
cout << "ECHEC DE LA CONNECTION" << endl;
}
cout << "</body>\n</html>\n";

return 0
}

And this generates the following in the Console:
Content-type: text/html

<html>
<body>
Connection OK
</body>
</html>
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 11:18 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0