Problem connecting to Oracle database using ASP
Date: 8 Jun 2003 20:49:17 -0700
Message-ID: <23869fd0.0306081949.41c46501_at_posting.google.com>
I have a test ASP page like the following. The IIS 5.0 and ORACLE
9i/Personal and the ASP all reside in my development machine. When
browsed the ASP using IE6, the browser kept turning and eventually
gave up. I created an ODBC DSN to test the connection using ODBC
driver. The connection was successful. I also use VB6.0 SP1 to
create a test project using the ODBC DSN and ORAOLDB. I also used the
VB sample provided by Oracle in the OLEDB/SAMPLE/ directory. They all
could connect to the ORACLE instance. I just can not get the ASP
connection working. The same connection strings are used in all test.
Please help. Thanks.
<%option explicit%>
'strCn = "Provider=MSDASQL.1;Persist Security Info=False;User
ID=xxx;Password=xxx;Data Source=oracle"
set cn = server.CreateObject("ADODB.connection")
with cn
Select Case cn.State
<%
Response.Expires = -1 'expires immediately
dim strCn, cn
dim strStatus
strCn = "Provider=ORAOLEDB.Oracle;Data Source=oracle;User ID=xxx;
password=xxx"
.connectionString = strCn
.open
end with
Case 1 'adStateOpen
Case 0 'adStateClosed
strStatus = "Closed"
Case Else
strStatus = "Other Status (" & cn.state & ")"
End Select
response.write "Connection state: " & strStatus
%>
Received on Mon Jun 09 2003 - 05:49:17 CEST