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.
improvvise Error on TMSConnectio.Connect
Try to check provider versions for different values of TMSConnection.Options.Provider. See the code below for example.
You should place TMSConnection, TButton, TMemo objects onto the form in the a new application to run this code.
What will be the result when you run an application based on this code on two clients having problems with connection?
You should place TMSConnection, TButton, TMemo objects onto the form in the a new application to run this code.
Code: Select all
procedure TForm1.Button1Click(Sender: TObject);
procedure Test(ProvName: string);
var
ver: string;
begin
try
ver := MSConnection1.ClientVersion;
except
ver := 'Cannot connect';
end;
Memo1.Lines.Add(ProvName + ': ' + ver);
end;
begin
Memo1.Clear;
MSConnection1.LoginPrompt := True;
MSConnection1.Disconnect;
MSConnection1.Options.Provider := prAuto;
Test('prAuto');
MSConnection1.LoginPrompt := False;
MSConnection1.Disconnect;
MSConnection1.Options.Provider := prSQL;
Test('prSQL');
MSConnection1.Disconnect;
MSConnection1.Options.Provider := prNativeClient;
Test('prNativeClient');
end;
I ave alrady tryed to change the data provider and i ave incresed the timeout connection with no resul , bat today i ave installed the SQL monitor on the client machine and these get the error
"SQL Network Interfaces Error Locating ServerInstance Specified [xFFFFFFFF]" jast before the program crash. I ave tried on the web and i find this page http://blogs.msdn.com/sql_protocols/arc ... 83684.aspx I ave followd the instruction of the point "message 6" and with this change on the sql server the applicatio go on.
But it remain to undstand becouse, without any warning and without any apparing change of configuration, application has stopped to work. The adpted solution is a workarround.
Regard
B.S.
"SQL Network Interfaces Error Locating ServerInstance Specified [xFFFFFFFF]" jast before the program crash. I ave tried on the web and i find this page http://blogs.msdn.com/sql_protocols/arc ... 83684.aspx I ave followd the instruction of the point "message 6" and with this change on the sql server the applicatio go on.
But it remain to undstand becouse, without any warning and without any apparing change of configuration, application has stopped to work. The adpted solution is a workarround.
Regard
B.S.