|
|
|
|
Re: Unable to connect with MS-ODBC to Oracle DB [message #377432 is a reply to message #377347] |
Tue, 23 December 2008 00:52 |
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 #377452 is a reply to message #377451] |
Tue, 23 December 2008 02:34 |
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
%>
|
|
|
|
|
|
|