Icon View Incident Report

Serious Serious
Reported By: Ronnie Burns
Reported On: 12/5/2000
For: Version 2.05 Build 1
# 672 Read Error #9217 Triggered When Trying to Read the Result Set of a Query

After downloading version 2.05, the code I'm using to copy the rows from a TDBIsamQuery to a TDBIsamTable gives the following message:

DBISAM Engine Error #9217 Error reading from table "E:\Delphi5\qsm\3290.dat"

When I exit and go back in, I get the same error when I run the query except instead of it saying '3290.dat' it said '3180.dat'.

The rows appear to be copying, but I don't know if I got them all. I ran the same query under version 2.03 before installing 2.05 and it worked fine.

procedure CopyDataSet(Source: TDBIsamQuery; Dest: TDBIsamTable);
var
  x, y, iRecNo, iCnt, iCutCnt: Integer;
  HoldField: TField;
  RecNoField: TField;
  TypeArray:  array[0..200] of TFieldType;
  FieldArray:  array[0..200] of TField;
begin
  iRecNo := 0;
  iCnt := 0;
  RecNoField := Dest.FindField('RecNo');
  MainStatusPanel.Caption := '0 Rows Loaded ...';
  Application.ProcessMessages;
  Dest.DisableControls;

//  
Let's fill the field array with our destination fields.

  for x := 0 to Source.FieldCount -1 do
    begin
      FieldArray[x] := Dest.FindField(Source.Fields[x].FieldName);
      if FieldArray[x] <> nil then
        TypeArray[x] := FieldArray[x].DataType;
    end;

  try
    with Source do
      begin
        while not Eof do
          begin
            Dest.Insert;
            for x := 0 to FieldCount -1 do
              if FieldArray[x] <> nil then
                case TypeArray[x] of
                  ftInteger:   TIntegerField(FieldArray[x]).Value := Fields[x].AsInteger;
                  ftCurrency:  TCurrencyField(FieldArray[x]).Value := Fields[x].AsCurrency;
                  ftDate:      TDateField(FieldArray[x]).Value := Fields[x].AsDateTime;
                  ftString:    TStringField(FieldArray[x]).Value := Fields[x].AsString;
                end;
            if RecNoField <> nil then
              begin
                inc(iRecNo);
                RecNoField.AsInteger := iRecNo;
              end;
            Dest.Post;
            inc(iCnt);
            if (iCnt mod 1000) = 0 then
              begin
                MainStatusPanel.Caption :=
                  FormatFloat('#,
##0', StrToFloat(IntToStr(iCnt)))  
                  ' Rows Loaded .
..';
                Application.ProcessMessages;
              end;
            next;
          end;
      end;
  finally
    Dest.First;
    Dest.EnableControls;
    MainStatuspanel.Caption := '';
  end;
end;



Comments Comments
This could also occur with exclusively-opened tables.


Resolution Resolution
Fixed Problem on 12/8/2000 in version 2.06 build 1
Image