improvvise Error on TMSConnectio.Connect
Posted: Tue 30 Oct 2007 18:10
my application is installed on 5 client and use sqlserver2005 express.
without warning 2 of the 5 client raise error on connection while remaining 3 connect fine. I ave modified the code for write en error code but the application crashed whitout error message.
The portion of code is
try
Connection.Connect;
Result:=cnOctoRubrica.Connected;
except
on E: EMSError do
begin
try
if E.MSSQLErrorCode <= NE_MAX_NETERROR
then StrErrore:=format('SQL=[%d]%s ',[StrErroreSQL(E.MSSQLErrorCode),E.MSSQLErrorCode])
else StrErrore:='';
StrErrore:=StrErrore + format('OLEDB=[0x%s] ',[IntToHex(E.OLEDBErrorCode,8)]);
finally
StrErrore:=StrErrore+E.LastMessage;
LogFile.Scrivi(lgErr,StrErrore);
end;
end;
on E: Exception do ErroreLog(E.Message);
else begin
Result:=False; raise;
end;
end;
--------------------------------------
it seems that the crash is in conncet istruction, but I do not succeed to simulate the problem in my dev machine, it is only in the machine of the client.
In all 5 client is installed the sql native client.
you have some idea on like having at least an error code ?
Regard
B.S.
without warning 2 of the 5 client raise error on connection while remaining 3 connect fine. I ave modified the code for write en error code but the application crashed whitout error message.
The portion of code is
try
Connection.Connect;
Result:=cnOctoRubrica.Connected;
except
on E: EMSError do
begin
try
if E.MSSQLErrorCode <= NE_MAX_NETERROR
then StrErrore:=format('SQL=[%d]%s ',[StrErroreSQL(E.MSSQLErrorCode),E.MSSQLErrorCode])
else StrErrore:='';
StrErrore:=StrErrore + format('OLEDB=[0x%s] ',[IntToHex(E.OLEDBErrorCode,8)]);
finally
StrErrore:=StrErrore+E.LastMessage;
LogFile.Scrivi(lgErr,StrErrore);
end;
end;
on E: Exception do ErroreLog(E.Message);
else begin
Result:=False; raise;
end;
end;
--------------------------------------
it seems that the crash is in conncet istruction, but I do not succeed to simulate the problem in my dev machine, it is only in the machine of the client.
In all 5 client is installed the sql native client.
you have some idea on like having at least an error code ?
Regard
B.S.