Hi
Acctualy, we keep trying to port our project to the new version of Water and Data Abstract. We want to compile and run it on both as Visual Studio 2019 as Elements Water. Follow some issues we have been having:
- First of all, after built it, when we start Debug → Run. It show us the first error.
We found some thread saying it was corrected. But seems it wasn`t, or is another kind.
Follow:
- If we ignore the 1), we are getting this another one (length cant be less than zero):
A problem similar with this another thread. But we couldn`t figure out.
Follow: Can't connect to Mysql using .net driver with Fire/Silver - #40 by mh
The error occurs at line:
conn := new TDAADOConn(self.connectionManager.AcquireConnection(‘ini’));
Where the connection string is assembled correctly and conn type is represented by IAbstractConnection
After that we get some cascade error that blocks authentication on the server:
On Visual Studio it works well.
Follow a little snippet of the code:
// conexão db
str := 'MySql.NET?Server=' + servidor;
str := str + ';Port=' + porta;
str := str + ';Database=' + ini.getValor('NomeBanco');
str := str + ';User ID=' + ini.getValor('Usuario');
str := str + ';Connect Timeout=300';
str := str + ';Default Command Timeout=' + timeout;
if not String.IsNullOrEmpty(maxPoolSize) then begin
str := str + ';Max Pool Size=' + maxPoolSize;
end;
str_i := str;
str := str + ';Password=' + TBaseConn.mapeiaSenha(ini.getValor('Usuario'),TCrypto.descriptografar(ini.getValor('Senha')),servidor,ini.getValor('NomeBanco'));
// adiciona definição
self.connectionManager.AddDefinition('ini',str,true);
// log
TLog.add('DB String : ' + str_i);
// testa conexao database
ok := false;
while not ok do begin
try
conn := new TDAADOConn(self.connectionManager.AcquireConnection('ini'));
ok := true;
except on E:Exception do begin
TLog.addError(E,'DB init Error. I will try again. ');
// tenta novamente 30s
Thread.Sleep(30000);
end;
end;
end;
Sorry for my english.
Regards.