Re: Problem connecting to Oracle database using ASP

From: Robert Dimitrovski <robert.dimitrovski_at_ht.hr>
Date: Mon, 9 Jun 2003 12:34:25 +0200
Message-ID: <1055154867.340209_at_tuxri2.tkcrij.ht.hr>


I had made a connection with Oracle base 8.1.7 and this is it: .Open "Provider=MSDAORA.1;Data Source=name you use in tnsnames;" & _

      "DNS=name of DNS;User Id=" & Text2.Text & ";Password=" & Text3.Text & ";"
I see in your code that you don't have DNS.

"js" <androidsun_at_yahoo.com> wrote in message news: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 - 12:34:25 CEST

Original text of this message