Lazarus
Programming => Databases => Topic started by: Prg1 on March 11, 2011, 05:49:14 am
-
Well, i've wrote a daemon(service) app for Windows, wich must to connect to any DB server using ZeosDB. It can connect to mySQL, FireBird, MSSQL, but can't connect to Oracle. When i trying set Connection:=true, process hangs. This happens only in daemon app. Traditional GUI app has no problem.
Please, help (if anybody knows how to) :'(
-
Set Connection:=true at design time?
-
I think this was the bug discussed in the other post.
I'm sure you have Delphi installed?
Ok, try something like this;
if the connection base is oracle or ms_access<try this data model if same problem>
Then try to set in TSQLQuery;
UsePrimaryKeyAsKey to False
Don't set the connection to true until UsePrimaryKeyAsKey is set to False
-
Thank you, xenablaise. I'll try as you wrote later, when i'll solve a problem with connection.
It just cant connect to oracle at runtime. At design time it connects perfect. When service is running, an attempt to connect to Oracle hangs app. That is, when i set TZConnection's property Connected to true, this service app stops responding.
Please, note, that i use Zeos Access components, not SQLdb.
help is very needed, amigos :(
-
I just made service app in Delphi, using Zeos Access, and connection to Oracle has been suxessfully established. Seems like a problem is in Lazarus or FPC.
enyone knows a problem?
P.S goodbye my dream about crossplatform web server with internal oracle support... :'(
-
lazarus + zeos work too, so I fail to see why you cannot connect to oracle.
Maybe some path is different, so your service cannot find the oracle dlls
-
Marc,
Maybe some path is different, so your service cannot find the oracle dlls
Why then it connects at design time successfully? and service written in Delphi + Zeos also connects fine?
%) can't see a reason of this behavior.
-
Does another service of yours work fine?
For test, a form with a dbgrid and a button to be used to open table could show while the service started with service management in control panel.
-
Marc,
Maybe some path is different, so your service cannot find the oracle dlls
Why then it connects at design time successfully? and service written in Delphi + Zeos also connects fine?
%) can't see a reason of this behavior.
A service path can be different from a user path, so I see at least one reason.
-
jixian.yang, yes. as i posted above, a service written in Delphi works fine and GUI app with a grid works perfect, but service of FPC/Lazarus hangs when Connected is set to true.
Marc, then can you please write me, how can i set a correct path to oracle dlls?
Environment variables are correct (c:\apps\oracle\product\10.2.0\client_1\bin;)
-
jixian.yang, yes. as i posted above, a service written in Delphi works fine and GUI app with a grid works perfect, but service of FPC/Lazarus hangs when Connected is set to true.
I think jixian.yang meant a Lazarus service
Marc, then can you please write me, how can i set a correct path to oracle dlls?
Environment variables are correct (c:\apps\oracle\product\10.2.0\client_1\bin;)
if you set this a system variable (opposite to user variable) then OK
-
jixian.yang, yes. as i posted above, a service written in Delphi works fine and GUI app with a grid works perfect, but service of FPC/Lazarus hangs when Connected is set to true.
I think jixian.yang meant a Lazarus service
Marc, then can you please write me, how can i set a correct path to oracle dlls?
Environment variables are correct (c:\apps\oracle\product\10.2.0\client_1\bin;)
if you set this a system variable (opposite to user variable) then OK
And set NLS_LANG and ORACLE_HOME too.