Home » Infrastructure » Windows » Unable to connect with MS-ODBC to Oracle DB (Oracle 9i)
Unable to connect with MS-ODBC to Oracle DB [message #355315] Thu, 23 October 2008 07:38 Go to next message
raniams
Messages: 22
Registered: September 2008
Location: Egypt
Junior Member
I'm using Windows server2000 and oracle 9i Database
I am trying to access Oracle Database through ASP Script, I'm getting the Following error.

Error Type (as shown on the Internet Explorer or Mozilla)
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Driver Manager] Driver's SQLAllocHandle on SQL_HANDLE_ENV failed
/fieldvisits/connection.inc, line 4


I already tried steps mentioned in thread
1- Unable to connect SQLState=IM004 Driver's SQLAllocHandle on SQL_HANDLE_ENV failed – url : http://www.orafaq.com/forum/m/101430/0/?srch=Unable+to+connect+SQLState%3DIM004+Driver%27s+SQLAllocHandle+on+SQL_HANDLE_ENV+failed#ms g_101430
AND
2- http://support.microsoft.com/default.aspx?scid=kb;en-us;Q306345

Plus we did reboot the server with No success

Plus (from regedit), the ORACLE_HOME is pointing to the correct file path

Please advice...

Re: Unable to connect with MS-ODBC to Oracle DB [message #355327 is a reply to message #355315] Thu, 23 October 2008 12:01 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Use Oracle driver instead of Microsoft one.

Regards
Michel
Re: Unable to connect with MS-ODBC to Oracle DB [message #377328 is a reply to message #355315] Mon, 22 December 2008 07:26 Go to previous messageGo to next message
raniams
Messages: 22
Registered: September 2008
Location: Egypt
Junior Member
I used Oracle driver instead of Microsoft one as adviced-
I tried the "Microsoft ODBC for Oracle" and the "Oracle in oraHome92"
I am using ASP Language.
Upon publishing on the IE - I get a blank page, with no rows retrieved from the DB.
I checked many of your threads in here and in link in http://www.dbforums.com/showthread.php?t=1621408
but no success.Please advice ASAP.

Notes: I only have one Oracle home and there are NO multiple entries in for oracle on my machine


Thanks

[Updated on: Mon, 22 December 2008 07:28]

Report message to a moderator

Re: Unable to connect with MS-ODBC to Oracle DB [message #377347 is a reply to message #377328] Mon, 22 December 2008 08:18 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Quote:
but no success.Please advice ASAP.

It takes you 2 months to answer the previous reply, I think ASAP (by the way, don't use IM speak) means a couple of weeks.
In addition, you didn't say anything that may help us help you.

Regards
Michel
Re: Unable to connect with MS-ODBC to Oracle DB [message #377432 is a reply to message #377347] Tue, 23 December 2008 00:52 Go to previous messageGo to next message
raniams
Messages: 22
Registered: September 2008
Location: Egypt
Junior Member
It took 2months to reply, because we were working on another project and had to submit beginning of this month.
At the meantime, our only concern is to successfully connect from MS to Oracle Server and retrieve data.

The steps that I did are as follows :
1- From my MS DB server, I did install Oracle Client in order to enable Oracle ODBC
2- From MS ODBC Database Admin-->System DSN(tab)-->added a new system db source, type:Oracle in OraHome92 - which a successfully connection message.

tried another instance using type:MS ODBC for Oracle.

3- From the SQL+, successfully retrieved data from the Oracle database
4- The code used is ASP as follows,

<%
Option Explicit
Dim strConnection, conn, rs, strSQL

strConnection = "Driver={Oracle in OraHome92};" & _
"Server=dbname;uid=username;pwd=password;"

Set conn = Server.CreateObject("ADODB.Connection")
conn.Open strConnection

Set rs = Server.CreateObject("ADODB.recordset")
strSQL = "SELECT ben_code FROM ben"
rs.open strSQL, conn, 3,3

rs.MoveFirst
WHILE NOT rs.EOF
     Response.Write(rs("ben_code") & "<br/>")
rs.MoveNext
WEND

rs.Close
Set rs = Nothing

conn.Close
Set conn = Nothing
%>

5- I also changed(on my MS DB server) the Local Security Policy under administrator tools giving users the ability to Create Global Objects.
6- The output obtained on the IE- is a blank screen with no records fetched from the DB.


I hope I have fully described the status I have in here.
If there are any technicalities I've missed, please tell me to help solve this issue.
Thanks

[Updated on: Tue, 23 December 2008 01:15]

Report message to a moderator

Re: Unable to connect with MS-ODBC to Oracle DB [message #377451 is a reply to message #377432] Tue, 23 December 2008 02:13 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Something is missing in your code: error handling.
I should add at each step if the object is created or operation done and if not display the error message.

Regards
Michel
Re: Unable to connect with MS-ODBC to Oracle DB [message #377452 is a reply to message #377451] Tue, 23 December 2008 02:34 Go to previous messageGo to next message
raniams
Messages: 22
Registered: September 2008
Location: Egypt
Junior Member
I don't have an error message displayed...that's my problem...
As for the error Handling;
All I could do in ASP is just display- the following as in red;
<%
Option Explicit
Dim strConnection, conn, rs, strSQL

strConnection = "Driver={Oracle in OraHome92};" & _
"Server=dl.world;uid=cd;pwd=cd2008;"

Set conn = Server.CreateObject("ADODB.Connection")
conn.Open strConnection

Set rs = Server.CreateObject("ADODB.recordset")
strSQL = "SELECT ben_code FROM ben"
rs.open strSQL, conn, 3,3
%>
<%
rs.MoveFirst
WHILE NOT rs.EOF%>
[COLOR=red]TEST[/COLOR]
<%     Response.Write(rs("ben_code") & "<br/>")
rs.MoveNext
WEND

rs.Close
Set rs = Nothing

conn.Close
Set conn = Nothing
%>

Re: Unable to connect with MS-ODBC to Oracle DB [message #377666 is a reply to message #377452] Wed, 24 December 2008 02:32 Go to previous messageGo to next message
raniams
Messages: 22
Registered: September 2008
Location: Egypt
Junior Member
I did new steps as mentioned in article
http://support.microsoft.com/kb/255084
Yet the problem remains,no error messages are displayed...and no records are fetched from the DB.
Please help.

[Updated on: Wed, 24 December 2008 02:58]

Report message to a moderator

Re: Unable to connect with MS-ODBC to Oracle DB [message #377672 is a reply to message #377452] Wed, 24 December 2008 02:54 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
For error handling I mean something like using the followings:
http://msdn.microsoft.com/en-us/library/aa905919(SQL.80).aspx
http://support.sas.com/documentation/tools/oledb/app_error_objects.htm
http://www.4guysfromrolla.com/webtech/060399-1.2.shtml

For IIS I don't know, maybe you should try Metalink, OTN or Google.

Regards
Michel

[Updated on: Wed, 24 December 2008 02:55]

Report message to a moderator

Re: Unable to connect with MS-ODBC to Oracle DB [message #377673 is a reply to message #377672] Wed, 24 December 2008 03:00 Go to previous messageGo to next message
raniams
Messages: 22
Registered: September 2008
Location: Egypt
Junior Member
Michel Cadot wrote on Wed, 24 December 2008 10:54


For IIS I don't know, maybe you should try Metalink, OTN or Google.




I already found that IIS -with Win server 2003, service pack 2 is compatible with Oracle 9i as in article http://support.microsoft.com/kb/926031

Thanks for your reply

Re: Unable to connect with MS-ODBC to Oracle DB [message #377675 is a reply to message #377673] Wed, 24 December 2008 03:07 Go to previous message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Unfortunatly in this document, "Oracle 9i" is as useless as "Windows 5".

Regards
Michel
Previous Topic: Oracle installation problem
Next Topic: could not install oracle
Goto Forum:
  


Current Time: Sun Nov 24 05:25:37 CST 2024