MyDAC - Connection - OnError event
MyDAC - Connection - OnError event
Hi!
I have one problem with OnError event at TMyConnection.
procedure TmyDataModule.MySQLConnectionError(Sender: TObject; E: EDAError; var Fail: Boolean);
begin
Fail:= False;
end;
I'm attribute in var Fail the value False for don't display error message, but every time is displayed the "Lost Connection ...." dialog.
MySQL server version: 4.1.14-standard-log
MySQL client version: Direct
MyDAC Version 5.20.1.14
Delphi 2006
Borland® Developer Studio for Microsoft® Windows™ Version 10.0.2558.35231 Update 2,
Hotfixed
Windows XP - SP3
Thank You!
I have one problem with OnError event at TMyConnection.
procedure TmyDataModule.MySQLConnectionError(Sender: TObject; E: EDAError; var Fail: Boolean);
begin
Fail:= False;
end;
I'm attribute in var Fail the value False for don't display error message, but every time is displayed the "Lost Connection ...." dialog.
MySQL server version: 4.1.14-standard-log
MySQL client version: Direct
MyDAC Version 5.20.1.14
Delphi 2006
Borland® Developer Studio for Microsoft® Windows™ Version 10.0.2558.35231 Update 2,
Hotfixed
Windows XP - SP3
Thank You!
Hi Dimon
I'm try to use this process in FailOver Demo
I'm kill session and try to execute Update Apply, but the
"Lost Connection ...." dialog appears.
Tks,
I'm try to use this process in FailOver Demo
Code: Select all
procedure TDM.ConnectionError(Sender: TObject; E: EDAError; var Fail: Boolean);
begin
Fail:= False;
end;
"Lost Connection ...." dialog appears.
Tks,
I am using 5.80.0.48 of MyDAC in Delphi 2007
Is this error fixed as of the above version because I cannot purchase/rollout even a beta with this not working.
If the MySQL connection is down, I then query a local DB (ElevateDB) to get the last updated data and if this error pops up, my Customer will close the applicaiton.
Please advise.
Thank you,
Daniel
Is this error fixed as of the above version because I cannot purchase/rollout even a beta with this not working.
If the MySQL connection is down, I then query a local DB (ElevateDB) to get the last updated data and if this error pops up, my Customer will close the applicaiton.
Please advise.
Thank you,
Daniel
Code: Select all
procedure TPOSDB.MyDACOnError(Sender: TObject; E: EDAError; var Fail: boolean);
var
sError: string;
begin
sError := E.Message;
if ( ( (pos('10061',sError) > 0) // cannot connect to DB
or (pos('10060',sError) > 0) // cannot connect to DB
or (pos('gone away',sError) > 0) // lost connection
or (pos('10065',sError) > 0) // connect to MySQL server
or (pos('Lost connection',sError) > 0) // 'Lost connection to MySQL server during query'
)
and ( (pos('select fn',lowercase(F_sMostRecentSQLStatement)) = 0) // do not "fail over" to elevate if using functions
// except for scanning of bands, fail those over
or (pos('fn_scan_wristband',lowercase(F_sMostRecentSQLStatement)) > 0)
)
) then
begin
if (objDBServer nil) then
begin
// only save locally if told to do so
if (objDBServer.F_bAllowAddToSQLToAddTable) then
begin
{ Send in the "main" objDBServer.F_objLocalDB to the rescue using its local object }
if (objDBServer.F_objLocalDB.AddSQLToQuery(objDBServer.F_sMostRecentSQLStatement, objDBServer.F_sMostRecentSQLToAddLocallyForServer)) then
begin
end;
end;
end;
Fail := False;
end;
end;
-
Challenger
- Devart Team
- Posts: 925
- Joined: Thu 17 Nov 2005 10:53