Page 1 of 1
how to hide error?
Posted: 12.01.2007, 22:38
by NeiSep
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 ?
Posted: 12.01.2007, 23:30
by mdaems
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
Posted: 13.01.2007, 00:12
by NeiSep
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
i mean like i get popup when i can't connect to MySQL server i do not want this to show as a message.
Posted: 13.01.2007, 00:25
by mdaems
Use a construction like this:
Code: Select all
try
Connect;
except
on e:EZSQLThrowable do HandleException(e);
end;
Not 100 % sure about syntax, but I thinkthis principle will do.
Mark
Posted: 13.01.2007, 13:11
by NeiSep
mdaems wrote:Use a construction like this:
Code: Select all
try
Connect;
except
on e:EZSQLThrowable do HandleException(e);
end;
Not 100 % sure about syntax, but I thinkthis principle will do.
Mark
where can i read about this ?
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.
Posted: 13.01.2007, 17:19
by mdaems
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 :
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,''));
Mark
Posted: 13.01.2007, 17:27
by NeiSep
mdaems 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 :
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,''));
Mark
but see see when i trying to use the code you told me to it complains that is unreconized: EZThrowable
Posted: 13.01.2007, 18:50
by NeiSep
Hey
i think i fixed it thank you very much for your help
Posted: 13.01.2007, 19:55
by NeiSep
How do i make this to not eat memory is it possibul to flush or clear after i done a query?
Posted: 13.01.2007, 20:50
by mdaems
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
Posted: 14.01.2007, 09:57
by NeiSep
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.
Posted: 15.01.2007, 13:12
by mdaems
Just close the query if you opened it with Query.Open. If you use execSQL this should not be necessary.
Do you know what exactly eats the memory?
Mark
Posted: 21.01.2007, 14:58
by NeiSep
Hmm okidkie weird entire app is so slow and it almost hangs itself four couple minutes then it works again and then it is the same.
Anyway im not sure what the problem with eating entire memory was but i think i did fixed it.