Re: Problem connecting to Oracle database using ASP

From: js <androidsun_at_yahoo.com>
Date: 9 Jun 2003 22:09:17 -0700
Message-ID: <23869fd0.0306092109.6c7187a6_at_posting.google.com>


Thanks for the reply. The following is my TNSNAMES.ORA file, I tried all and none got connection. I am trying to use ORAOLEDB.ORACLE provider.

# TNSNAMES.ORA Network Configuration File: E:\oracle\ora92\NETWORK\ADMIN\tnsnames.ora # Generated by Oracle configuration tools.

ORACLE.UNIVERSE.COM =
  (DESCRIPTION =
    (ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = <b>sun3</b>)(PORT = 1521))
    )
    (CONNECT_DATA =
(SERVICE_NAME = Oracle.Universe)

    )
  )

EXTPROC_CONNECTION_DATA.UNIVERSE.COM =
  (DESCRIPTION =
    (ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    )
    (CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)

    )
  )

INST1_HTTP.UNIVERSE.COM =
  (DESCRIPTION =
    (ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = sun3)(PORT = 1521))
    )
    (CONNECT_DATA =
(SERVER = SHARED)
(SERVICE_NAME = MODOSE)
(PRESENTATION = http://HRService)
    )
  )

OEMREP.UNIVERSE.COM =
  (DESCRIPTION =
    (ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = sun3)(PORT = 1521))
    )
    (CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = OEMREP.universe.com)
    )
  )

"Robert Dimitrovski" <robert.dimitrovski_at_ht.hr> wrote in message news:<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 Tue Jun 10 2003 - 07:09:17 CEST

Original text of this message