how to hide error?
Moderators: gto, cipto_kh, EgonHugeist
how to hide error?
Hello
how do i hide errors i looked in the exampels but nobody did take this up.
i want to show errors in file i do not want a popup in the software and i can't find in out any knows what todo ?
how do i hide errors i looked in the exampels but nobody did take this up.
i want to show errors in file i do not want a popup in the software and i can't find in out any knows what todo ?
i mean like i get popup when i can't connect to MySQL server i do not want this to show as a message.mdaems wrote:What kind of errors are you looking for?
As far as I know all errors raise a normal exception. How to catch them is Object Pascal, not Zeoslib, I would think. If you catch exceptions of EZSQLThrowable class you will have most of Zeoslib exceptions.
Mark
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
Use a construction like this:
Not 100 % sure about syntax, but I thinkthis principle will do.
Mark
Code: Select all
try
Connect;
except
on e:EZSQLThrowable do HandleException(e);
end;
Mark
where can i read about this ?mdaems wrote:Use a construction like this:Not 100 % sure about syntax, but I thinkthis principle will do.Code: Select all
try Connect; except on e:EZSQLThrowable do HandleException(e); end;
Mark
i want to learn how to use this stuff.
and i do not use EZSQLThrowable i use only 3 components:
TZConnection, TZQuery, TZSQLMonitor
And i want to get errors only shown by TZSQLMonitor i do not want any popup message about connection success i want it manualy to the TZSQLMonitor if you understand what i mean.
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
EZThrowable is the exception class raised by our components. The ones you mentioned above.
Just look for things like 'Exception handling', 'Exceptions', 'raise', 'Try except' in Delphi Help or a standard work about delphi/object pascal.
It is possible to write to the ZSQLMonitor manually.
You'll need to add ZDbcLogging, ZSQLMonitor to your uses clause.
Then you can create the monitor and log some stars to it using this code :
Mark
Just look for things like 'Exception handling', 'Exceptions', 'raise', 'Try except' in Delphi Help or a standard work about delphi/object pascal.
It is possible to write to the ZSQLMonitor manually.
You'll need to add ZDbcLogging, ZSQLMonitor to your uses clause.
Then you can create the monitor and log some stars to it using this code :
Code: Select all
TZMonitor := TZSQLMonitor.Create(Application);
TZMonitor.FileName := 'MysqlTrace.txt';
TZMonitor.Active := true;
TZMonitor.AutoSave := true;
TZMonitor.MaxTraceCount := 10000;
TZMonitor.LogEvent(TZLoggingEvent.Create(lcOther,'','***********',0,''));
but see see when i trying to use the code you told me to it complains that is unreconized: EZThrowablemdaems wrote:EZThrowable is the exception class raised by our components. The ones you mentioned above.
Just look for things like 'Exception handling', 'Exceptions', 'raise', 'Try except' in Delphi Help or a standard work about delphi/object pascal.
It is possible to write to the ZSQLMonitor manually.
You'll need to add ZDbcLogging, ZSQLMonitor to your uses clause.
Then you can create the monitor and log some stars to it using this code :
MarkCode: Select all
TZMonitor := TZSQLMonitor.Create(Application); TZMonitor.FileName := 'MysqlTrace.txt'; TZMonitor.Active := true; TZMonitor.AutoSave := true; TZMonitor.MaxTraceCount := 10000; TZMonitor.LogEvent(TZLoggingEvent.Create(lcOther,'','***********',0,''));
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
After a query you do just 'close' to free the memory taken by a result. Of course, if you create new query objects during runtime,you have to free them as well.
Normally the number of memory leaks must be limited,but if you find one, tell us.
If your procedure keeps leaking, we'll need to know what you have written.
BTW, I hope you do not always call all 6 lines of code above when you want to log? That would declare the leaking. Only the first time the first 5 lines are needed to create a monitor. If you put one on a form, you don't even need those 5 lines.
Mark
Normally the number of memory leaks must be limited,but if you find one, tell us.
If your procedure keeps leaking, we'll need to know what you have written.
BTW, I hope you do not always call all 6 lines of code above when you want to log? That would declare the leaking. Only the first time the first 5 lines are needed to create a monitor. If you put one on a form, you don't even need those 5 lines.
Mark
well okey close but oki i gone check what am i gone close the query or the connection to MySQL ?
Becuse im doing a server thats get registration from several hubs and adds infomation to MySQL db and for this i need the connection to be alive all the time until i shut it down.
And if i was gone call any close then i think the process will be destroyed and this will not work for me.
Becuse im doing a server thats get registration from several hubs and adds infomation to MySQL db and for this i need the connection to be alive all the time until i shut it down.
And if i was gone call any close then i think the process will be destroyed and this will not work for me.