Page 1 of 1

trouble connecting oracle

Posted: 17.11.2005, 15:02
by zx
greetings everyone.

smth strange happens..

i try to connect Oracle 9i database on winxp pro host.

I use zConnection and zQuery.

in designtime i set properties the way like:
Connection.database = db..
Connection.hostName = host..
Connection.password= usr_pwd
Connection.port = 1521
Connection.protocol= oracle or oracle9i

Protocol = 'oracle-9i'
HostName = 'taa'
Port = 1521
Database = 'zxschema'
User = 'zxshnur'
Password = 'zx'
AutoCommit = True
ReadOnly = False
TransactIsolationLevel = tiReadCommitted
Connected = True

and zQuerie's sql is something like:
select * from x

when i open zQuery in design-time it openes ok., linked grid displays records & so on.

when i try to run the app and connect database in runtime i get:

Exception EZSQLException in module Project1.exe at 000D06E7.
SQL Error: ORA-12154: TNS: unable to resolve service name

how can it happen it connects OK in designtime and fails in runtime ????

this happens with zeos DBO v.6.5.1 and v.6.5.1-latest cvs from download section as well..

Posted: 17.11.2005, 16:29
by suntech
Hi, zx!

Try to set LOCAL='SID' IN HKLM\SOFTWARE\ORACLE\HOME0 in your registry. Check and if it exists remove domain prefix from OracleHome\Network\Admin\tnsnames.ora (yourSID) + (change from domain name to ip), comment all lines in sqlnet.ora in the same directory.
Restart tnslistener service.

Best regards.

Did the advice work ?

Posted: 12.09.2006, 11:36
by Lorenz
I'am getting the same error I can connect at Design time
but not with the complied exe.

keep getting following message

'Requested database driver was not found'

eventhough this has been set to oracle-9i

Strange though it works perfectly in designtime
displaying the result in grid as expected

Using Zconnect and ZReadonlyQuery

any Ideas ?

Posted: 12.09.2006, 11:52
by Lorenz
I have tried all advice above and still get the error ?

Posted: 12.09.2006, 12:05
by mdaems
This might be the problem with different dll versions being loaded. If there are more versions of the oracle dll's (oci.dll) on the system, or the only version is in the path of the IDE but not the path of the exe file, you can have this kind of problems.

I don't know how you can find out which dll (and eventually dependent dll's) is exactly loaded at design time.

Mark

Posted: 12.09.2006, 12:38
by Lorenz
Thanks for the Advice

I have run the application succesfully one a second development PC
installed on VMWARE virtual machine and connect to both local and remote Oracle DBs and it works fine.

So I imagine there must be a Second OCI.dll lurking somewhere on my normal development pc which needs to be clean out.

Oracle has been installed many times on this machine so I assume there is some garbage that needs clearing out.

Thanks for the prompt responses.

Adieu
:-)

Posted: 21.09.2006, 15:32
by clebernardelli
Hi.

Somebody already tried to connect in the Oracle without having the Oracle client installed?

That is I want to connect using only the necessary libraries (oci.dll,…), informing the IP of the server, user, database...

Somebody ?

Thanks.

Posted: 22.09.2006, 09:59
by pol
Hi,

Have you tried to use the Instant Client? This one consists mainly of some dlls. It can be downloaded from technet for free. You will still need a tnsnames.ora (with IP of the server etc.) and an environment variable TNS_ADMIN which points to the directory where tnsnames.ora is located.

hth

Rüdiger