i have to add a some events to my connection to handle errors and lost connection but dont know how this is possible
my code is like this
Code: Select all
procedure AfterDisConnectMysqlProcess();
begin
form2.Timer2.Enabled:=false;
form2.Timer3.Enabled:=false;
end;
procedure AfterConnectMysqlProcess();
begin
form2.Timer2.Enabled:=true;
form2.Timer3.Enabled:=true;
end;
...
UniConnectionRead := TUniConnection.Create(nil);
UniConnectionRead.ProviderName:='Mysql';
UniConnectionRead.Server := globalDBIP;
UniConnectionRead.Username := globalDBUn;
UniConnectionRead.Password := globalDBPass;
UniConnectionRead.Database := globalDBName;
UniConnectionRead.AutoCommit := true;
UniConnectionRead.SpecificOptions.Values['MySQL.UseUnicode'] := 'True';
UniConnectionRead.Connected := true;
UniConnectionRead.AfterConnect := form2.AfterConnectMysqlProcess();
UniConnectionRead.AfterDisconnect := AfterDisConnectMysqlProcess();
Code: Select all
[dcc32 Error] Unit2.pas(29610): E2010 Incompatible types: 'TNotifyEvent' and 'procedure, untyped pointer or untyped parameter'