Problem connecting to Oracle database using ASP
Date: 8 Jun 2003 20:49:16 -0700
Message-ID: <23869fd0.0306081949.20ecf9ff_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%>
<%
Response.Expires = -1 'expires immediately
dim strCn, cn
dim strStatus
'strCn = "Provider=MSDASQL.1;Persist Security Info=False;User
ID=xxx;Password=xxx;Data Source=oracle"
strCn = "Provider=ORAOLEDB.Oracle;Data Source=oracle;User ID=xxx;
password=xxx"
set cn = server.CreateObject("ADODB.connection")
with cn
.connectionString = strCn
.open
end with
Select Case cn.State
Case 1 'adStateOpen
strStatus = "open"
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:16 CEST