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, ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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> |