Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle connection through ASP
Hi.
Error 12154 means ..."TNS. Could not resolve service name". That means you
haven't got an entry named myDataSource in the TNSNAMES.ORA file pointing to
your database server.
Then you must check.
1º ORACLE_HOME system environment variable has been defined right.
2º If you have set a system environment variable called TNS_ADMIN then you
must have a TNSNAMES.ORA file in this directory.
3º Check you have an entry in the correct TNSNAMES.ORA that points to your
database server.
4º Test conectivity from the command line executing the next sentence.
TSNPING myDataSource.
But a quicker workaround, I use to put the connect string without aliases, Because I can develop asp pages, but I can not touch any configuration in the production environment.
Then try this.
<%
strConnect = "Provider=MSDAORA;User ID=YOURUSERNAME;Data
Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=THEHOSTWHEREYOURDATABASEIS)
(PORT=THELISTERNERPORT))(CONNECT_DATA=(SID=YOURDATABASESID)));Persist
Security Info=False;password=YOURPASSWORD"
Set objRS=CreateObject("ADODB.Recordset")
objRS.activeconnection=strConnect objRS.source= "select sysdate from dual" objRS.open
Look that this connect string uses the SQLNet complete string reather than
the alias.
If you use other protocol, use your SQLNET connect string.
Hope this helps.
Marco.
"Ruud" <gururuud_at_hotmail.com> wrote in message
news:4db2e9a.0209190222.1db59b55_at_posting.google.com...
> Hello,
>
> I'm using an ASP script to connect to an ORACLE database. I'm trying
> to connect with the following script:
>
> <%
> Set cnnOracle = Server.CreateObject("ADODB.Connection")
> strConn = "Provider=MSDAORA.1; Data Source=myDataSource; User
> ID=myUserID; Password=myPassword"
> cnnOracle.Open strConn
> %>
>
> However, i'm receiving the following error message all the time:
>
> Error Type:
> Microsoft OLE DB Provider for Oracle (0x80004005)
> Error while trying to retrieve text for error ORA-12154
> /FundPartners/Corporate/crm/index7.asp, line 8 (LINE 2 IN THE LINES
> SHOWN)
>
> The SQLnet.log gives the following:
>
> Fatal NI connect error 12560, connecting to:
>
(DESCRIPTION=(ADDRESS=(PROTOCOL=BEQ)(PROGRAM=oracle)(ARGV0=oracleORCL)(ARGS=
'(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))'))(CONNECT_DATA=(SID=ORCL
)(CID=(PROGRAM=C:\WINNT\System32\dllhost.exe)(HOST=EXCHANGE)(USER=IWAM_EXCHA
NGE))))
>
> VERSION INFORMATION:
> TNS for 32-bit Windows: Version 8.1.7.0.0 - Production
> Oracle Bequeath NT Protocol Adapter for 32-bit Windows: Version
> 8.1.7.0.0 - Production
> Time: 18-SEP-2002 16:42:18
> Tracing not turned on.
> Tns error struct:
> nr err code: 0
> ns main err code: 12560
> TNS-12560: Message 12560 not found; No message file for
> product=NETWORK, facility=TNS
> ns secondary err code: 0
> nt main err code: 530
> TNS-00530: Message 530 not found; No message file for
> product=NETWORK, facility=TNS
> nt secondary err code: 126
> nt OS err code: 0
>
>
> Also by connecting through ORACLE ODBC I'm getting the ORA-12154
> error. Using MS ODBC for ORACLE gives all kind of MS errors...
>
> Any suggestions??!?!?!?
>
> Thanx
Received on Thu Sep 19 2002 - 06:33:05 CDT
![]() |
![]() |