Page 1 of 1

Permanent errors in 6.6.6 stable - MSSQL Server

Posted: 29.09.2011, 11:39
by PetyaMaster
Hello,

I continuously receive various types of Exceptions all coming from TZDBLibMSSQL7PlainDriver.CheckError; mostly not derived down to any specific class, probably from the last line, but not always.
I'm afraid the primary reason is the TODO comment at the beginning of the method.
Can I expect that function to be implemented in the near future ?
What can I do until then ?

Code: Select all

procedure TZDBLibMSSQL7PlainDriver.CheckError;
var
  I: Integer;
  S: string;
  lErrorEntry: PDBLibError;
  lMesageEntry: PDBLibMessage;
begin
  { TODO -ofjanos -cGeneral : Error handling should be based on connection object.
  At the moment it is global. }
  if (MSSqlErrors.Count = 0) and (MSSqlMessages.Count = 0) then
    Exit;
  S := '';
  for I := 0 to MSSqlErrors.Count - 1 do
    S := S + PDBLibError(MSSqlErrors.Items[I]).DbErrStr + ' '
      + PDBLibError(MSSqlErrors.Items[I]).OsErrStr + ' '#13;
  for I := 0 to MSSqlMessages.Count - 1 do
    if PDBLibMessage(MSSqlMessages.Items[I]).Severity > EXINFO then
      S := S + PDBLibMessage(MSSqlMessages.Items[I]).MsgText + ' '#13;
  while MSSqlErrors.Count > 0 do
  begin
    lErrorEntry := MSSqlErrors.Items[0];
    Dispose(lErrorEntry);
    MSSqlErrors.Delete(0);
  end;
  MSSqlErrors.Clear;
  while MSSqlMessages.Count > 0 do
  begin
    lMesageEntry := MSSqlMessages.Items[0];
    Dispose(lMesageEntry);
    MSSqlMessages.Delete(0);
  end;
  MSSqlMessages.Clear;
  if S <> '' then
    raise Exception.Create(S);
end;
You can see relative line numbers in the attached report in brackets.

Any help will be highly appreciated.

Thanks, Peter

-----
Delphi 5.0 (I know it's one of the oldest)
ZeosDBO 6.6.6-stable
EurekaLog 6.0.14

Posted: 08.10.2011, 20:15
by mdaems
Can I expect that function to be implemented in the near future ?
Peter, I'm very sorry to tell, but no, you can't.
Mainly because there are no active developers using this MSSQL driver. (Never used it myself too)
Concerning the TODO : it looks to me doing this would ask for a major rewrite of the zeoslib code.
However, it's possible you can make the (mssql specific) code much more stable when you catch these exceptions when they happen at connection time and handle them more gently (like cleaning up half opened connection objects before raising the exception again). But I must say, I have no idea at all how mssql errors are handled at the moment.

Mark