Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> VB App using Oracle Objects 2.1 Failure with 12154 TNS Server Name error
This is a multi-part message in MIME format.
--------------471E31A2AED6D526757345B6 Content-Type: text/plain; charset=us-ascii Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Transfer-Encoding: 7bit
Help!
We have a 16 bit VB 4.0 application that connects to Oracle 7.3.2 database using Oracle Objects for OLE v1 that works fine. We are attempting to ugrade to Oracle Objects for OLE 2.1 and our application is failing with an Oracle error 12154 Unable to resolve TNS name error. We are using SQL*Net version 2.2.2.0.7A. Attached is a VB code snippet that is failing on the second database connection. Once a failure occures all subsequent attempts to connect fail. I almost suspect that the database string being used to connect to the database seems to be somehow getting corrupted between subsequent connections to the database. Attached is also our SQL*Net trace file if that helps at all. We have left the database string off of our login screen and just tried to use whatever is in the LOCAL= of the ORACLE.INI, we have experimented with changing our object instantiation from early to late binding, and we have also attempted to move the code to attempt the connections back to back before attempting anything else. This actually seemed to have promise in that it worked for the attached test application, however when we attempted to try this in the production code it failed again with our infamous 12154 error. Not to muddy the waters but could both versions of Oracle Objects co-habitate and exist in the registry and we continue to use the old version. We havn't actually attempted this yet but seems a bit of a cludge. We would really like to get our application to work with the new version of Oracle Objects since it corrects a known EOF bug.
If anyone can shed some light on this subject we would greatly appreciate any input as my boss is starting to panic.
Thanks,
Rick Brown
rbrown_at_ziplink.net
--------------471E31A2AED6D526757345B6 Content-Type: text/plain; charset=us-ascii; name="Vbform.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="Vbform.txt"
Private Sub m_cmdOK_Click()
Dim OraSession As Object
Dim OraDatabase As Object
Dim ProjectUpdater As Object
Dim mydyna As Object
Dim bloginok As Boolean
Dim UserName$, Password$, DatabaseName$, Connect$
On Error GoTo OK_Click_ErrHndl
UserName$ = Trim(UCase(txtUserName.Text)) Password$ = Trim(UCase(txtPassword.Text)) DatabaseName$ = Trim(txtDatabaseName.Text)
Connect$ = Trim(UserName$ + "/" + Password$)
'Initialize and create an Oracle session
Set OraSession = Nothing
Set OraSession = CreateObject("OracleInProcServer.XOraSession")
'Create an Oracle database object from above session (can have multiple instances 'per session)
Set OraDatabase = Nothing
Set OraDatabase = OraSession.DbOpenDatabase(DatabaseName$, Connect$, 0&)
Set mydyna = Nothing
Set mydyna = OraDatabase.CreateDynaset("select * from tlscprojmgmt.cost", 0&)
Set ProjectUpdater = Nothing
Set ProjectUpdater = CreateObject("Tom16.application.1")
'*** '*** connect to project updater '***
bloginok = ProjectUpdater.Connect(DatabaseName$, UserName$, Password$, False)
MsgBox "OKEE-DOKEY", vbInformation
Unload frmLogin
Exit Sub
OK_Click_ErrHndl:
MsgBox "Error in Logon" & vbCrLf & _ "Error: " & Str$(Err.Number) & Err.Description & vbCrLf & _ "Login form OK Click Event" & vbCrLf & _ "Contact CrossRoads support", vbExclamation, App.EXEName Me.Refresh Set OraSession = Nothing Set OraDatabase = Nothing Set ProjectUpdater = Nothing End
End Sub
--------------471E31A2AED6D526757345B6 Content-Type: text/plain; charset=us-ascii; name="Sqltr2.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="Sqltr2.txt"
Attempted load of local pfile source C:\WINPROJ\sqlnet.ora Parameter source was not loaded
-> PARAMETER TABLE LOAD RESULTS FOLLOW <-
Successful parameter table load
-> PARAMETER TABLE HAS THE FOLLOWING CONTENTS <-
trace_directory_client = C:\TEMP
AUTOMATIC_IPC = OFF
trace_level_client = 8
log_directory_client = C:\TEMP
log_file_client = sqlnet
SQLNET.EXPIRE_TIME = 2147483647
trace_file_client = sqltr1
--- PARAMETER SOURCE INFORMATION ENDS ---
nncpmlf_make_local_addrfile: construction of local names file failed nncpmsf_make_sys_addrfile: system names file is j:\oracl\network\admin\tnsnames.ora nncpcin_maybe_init: initial retry timeout for all name servers is 500 csecs nncpcin_maybe_init: max request retries per name server is 2 nncpcin_maybe_init: default name server domain is [root]osnqrn: Using nnfsn2a() to build connect descriptor for (possibly remote) database. nncpldf_load_addrfile: initial load of names file j:\oracl\network\admin\tnsnames.ora nncpldf_load_addrfile: success
nric2a: Getting local community information nriglp: Looking for local addresses setup by nrigla nriglp: No addresses in the preferred address list nric2a: TNSNAV.ORA is not present. No local communities entry. nrigla: Getting local address information nrigla: Simple address... nrigla: No community component so just use straight address nridst: Resolving address to use to call destination or next hop nridst: Found destination address nridst: Local address nridst: Local destination community found nric2a: This is a local community accessnricall: Got routable address information nricall: Making call with following address information: (DESCRIPTION=(CONNECT_DATA=(SID=A)(CID=(PROGRAM=J:\XRD\EXE\XRD00001.EXE)(HOST=Windows PC)(USER=OraUser)))(ADDRESS=(PROTOCOL=TCP)(HOST=p00s14f)(PORT=1521))) nricdt: Calling with outgoing connect data (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=p00s14f)(PORT=1521))(CONNECT_DATA=(SID=A)(CID=(PROGRAM=J:\XRD\EXE\XRD00001.EXE)(HOST=Windows PC)(USER=OraUser)))) nscall: connecting...
nsopen: opening transport... nttcni: trying to connect to socket 0. nsopen: transport is open nsopen: global context check-in (to slot 0) completenscon: doing connect handshake...
nscon: got NSPTAC packet nscon: connect handshake is complete nscon: nsctxinf[0]=0x9, [1]=0x8
nricall: Exiting NRICALL with following termination result 0 nspsend: 34 bytes to transport nsprecv: 43 bytes from transport nspsend: 431 bytes to transport nsprecv: 400 bytes from transport nspsend: 101 bytes to transport nsprecv: 52 bytes from transport nspsend: 118 bytes to transport nsprecv: 33 bytes from transport nspsend: 18 bytes to transport nsprecv: 20 bytes from transport nspsend: 15 bytes to transport nsprecv: 14 bytes from transport nspsend: 264 bytes to transport nsprecv: 35 bytes from transport nspsend: 15 bytes to transport nsprecv: 11 bytes from transport nspsend: 13 bytes to transport nsprecv: 11 bytes from transport
nspsend: 10 bytes to transport nsclose: closing transport nsclose: global context check-out (from slot 0) complete
--------------471E31A2AED6D526757345B6-- Received on Wed Jul 02 1997 - 00:00:00 CDT
![]() |
![]() |