Link to home
Start Free TrialLog in
Avatar of Whah
Whah

asked on

Oracle DB lookup error - TNS could not resolve the connect identifier specified

Hi,

I am currently trying to find the cause of an error in some code that I did not write. This code was developed as a way to run an Oracle DB lookup to simplify data entry into a Kofax Ascent Capture system. I am not a coder myself so I am struggling to find the real issue. They have a working system on Windows XP that uses this same dll, and they have recently upgraded some workstations to Windows 7 64-bit. They have installed the 32-bit Oracle client, and named the DSN the same name as it was in XP. A dll for the lookup gets registered on the system called "FieldLookup", and I have some error catching set up in the validation script to tell me on what line the error happens. The error is specified on line 368, and when I go to this line I see this: "oFieldLookup.Init"

There are two errors that are accompanied that say "ERROR [08004][Oracle][Ora]ORA-12154: TNS: could not resolve the connect identifier specified

Error [IM006][Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed"

I have opened the dll in Visual Studio, and I can see the Init in the FieldLookup.dll, but I don't know how to open this to see what it does to figure out if there is something in it that is configured incorrectly or what.


I am referencing this article because it seems like it could be the solution. I believe that I found the Oracle home directory, but the tnsnames.ora file and the others that that the article speaks of is not in it. Could that be the whole problem? I just don't know enough about Oracle to know if that is what I need to resolve this error.

https://forums.oracle.com/thread/2506724


Any help is appreciated.

Thanks,

Whah
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

After you install the correct Oracle client with appropriate data access drivers, you need to manually set up the tnsnames.ora and possible the sqlnet.ora files.

Should be able to copy it from the working XP system.

To do this, you need information from the database server itself (It should also have a copy of the tnsnames.ora file that you can copy).



Do you have a DBA for the system?
Avatar of Whah

ASKER

Upon closer examination it appears that the tnsnames.ora and sqlnet.ora files are where they should be, and are in the same location as they are on the working XP machine. I found them here.
C:\oracle\product\10.2.0\client_1\NETWORK\ADMIN

Thanks again,

Brian
I would also suggest you use Oracle's ODBC drivers, not Microsoft's...
>>and are in the same location as they are on the working XP machine

But, do they contain the same entries?  Copy the one's from the XP machine.
Avatar of Whah

ASKER

They do have a DBA, but they think this error is related to where the DLL is located. They say that they have seen this error before, and this that it is due to it being in the (x86) directory.
Avatar of Whah

ASKER

Ok, I copied the ones from the XP machine, and I am still getting the same error, so I have to believe those are correct now.
The DBA can make sure you have the correct entries in the tnsnames.ora file.  I forgot you had a working XP machine so no need to involve the DBA yet.

I don't think this is the issue right now but another thing to look at is the Bit version of ODBC you created the DSN with.

In a 64Bit Windows setup, there are two.  The 32Bit one is in the syswow64 folder:
http://support.microsoft.com/kb/942976
>> I copied the ones from the XP machine, and I am still getting the same error

Form a command prompt, see if you have tnsping (depending on what client/options you installed, you may or may not have it):
tnsping ORACLE_SID

where ORACLE_SID is the database alias inside the tnsnames.ora file you are trying to connect with.
Avatar of Whah

ASKER

I did create the DSN from the syswow64 folder, because I know that Kofax only supports 32-bit ODBC.

Thank you very much for the help, slightwv.
Avatar of Whah

ASKER

Here is the result of that.


Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\admin>tnsping ORACLE_SID

TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 28-OCT-2
013 15:41:41

Copyright (c) 1997, 2005, Oracle.  All rights reserved.

Used parameter files:
C:\oracle\product\10.2.0\client_1\network\admin\sqlnet.ora

TNS-03505: Failed to resolve name
Avatar of Whah

ASKER

oops sorry. I didn't read that last line. I will try again.
Avatar of Whah

ASKER

Now I am getting this.

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = intradb)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = TAGUS)))
OK (0 msec)
OK, now we know Oracle networking is set up correctly.  Hence the "OK (0 msec)"

From the ODBC Admin, can you 'Test' the connection?
Avatar of Whah

ASKER

I have, and it does test successfully.
If you've tested the DSN and it works but the app fails, then the app must not be using the  DSN entry you think it is using.

Just for grins, do you have a 32Bit Access installed or some other 32Bit app that can easily use the same DSN?
Avatar of Whah

ASKER

The DSN names do match, and they are simply named "Oracle" on both the working an non-working stations.  

It doesn't appear that they have Access installed. Any ideas for something that I can try with the DSN other than that?


Thanks again.
Check the drivers for the DSN.  The name of the DSN doesn't matter.

I still suggest you use the native Oracle ODBC drivers instead of the Microsoft ones.

When you installed the Oracle Client, did you install the ODBC drivers?
Avatar of Whah

ASKER

I'm going to have to check with my contact there. He was the one that installed the driver, and I believe he installed everything.
Avatar of Whah

ASKER

I was able to confirm that we are using the Oracle ODBC drivers.
Can you reconfirm your error?  I'm far from an Expert in ODBC but the original error posted seems to show the Microsoft driver:  [Microsoft][ODBC Driver Manager]
Avatar of Whah

ASKER

No problem. User generated image
Avatar of Whah

ASKER

User generated image
SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Whah

ASKER

Ok, I will check on that. I really appreciate all the help, slightwv. Thanks.
Avatar of Whah

ASKER

I have found a couple links that may support your compatibility theory.

This one says to use the Oracle 10g Release 2 for Windows Vista, but it's from 2010. https://forums.oracle.com/message/4108968

And this one says that the earliest supported version for Windows 7 is Oracle 11g release 2. http://kb.iu.edu/data/axju.html
Avatar of Whah

ASKER

I am now thinking that these may be related to installing the database software itself and not the ODBC driver version.
>> may be related to installing the database software itself and not the ODBC driver version.

Oracle can be confusing at times.  It was client/server long before client/server was a hot topic.

As long as the ODBC drivers are installed, it doesn't matter if they were installed as part of he 'server install' or not.  The Oracle server comes with the client built in.

Now, if you have a separate client installed on the same machine, you need to make sure that each client refers to the correct installation folder for it's config files.

Typically every Oracle install has it's own copy of the tnsnames.ora file.  If you want a 'shared' version, you can set an environment variable TNS_ADMIN that points to the folder containing the common tnsnames.ora file.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Whah

ASKER

The reason that my own comment was selected was because I was able to finally find a post that specifically mentioned both errors, and the recommended course of action in that article ultimately fixed this issue for me.