Icon View Incident Report

Serious Serious
Reported By: Rolf Frei
Reported On: 4/7/2003
For: Version 3.24 Build 1
# 1386 CopyOnAppend Causes 8708 Error with BLOB Fields

There seems to be a problem with CopyOnAppend and memo fields in 3.21 wich results in a cascading 8708 error and finally a stack overflow.

Here are the steps for the test sample:

1. Compile and run the attached sample project (D7 here)
2. Press the + (Add record) of the navigator and add some data into the ID
(PK), Infotext and the Weblink and save that record.
3. Press again the + button and change the ID to a new value and add some
infotext and a weblink and save the new record.
4. Now press the previous record button and change the text in the Weblink
Editbox to an other value.
5. Press the Save button to change the modifiaction of the first record.

Now you get a cascading 8708 error if you run the application inside the Delphi IDE, or outside the IDE the applicaitons gets closed (as a stack overflow will occur).

Now you can again restart the application, but now you will get the error 8708 as soon you move to the second record. You must repair the table to make it work again.

unit FIncludeEditorMain;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, 
Dialogs,
  DBCtrls, DB, DBISAMTb, DBActns, StdActns, ActnList, ImgList, ComCtrls,

  RFComCtrls, StdCtrls, TB97Ctls, ExtCtrls, Mask;

type
  TfrmMain = class(TForm)
    Panel2: TPanel;
    lblWeblink: TLabel;
    edtWebLink: TDBMemo;
    rfStatusBar1: TrfStatusBar;
    dsArtikel: TDataSource;
    tblArtikel: TDBISAMTable;
    tblArtikelPartNo: TStringField;
    tblArtikelWebLink: TMemoField;
    tblArtikelInfo: TMemoField;
    tblArtikelEnabled: TSmallintField;
    DBMemo1: TDBMemo;
    DBNavigator1: TDBNavigator;
    Panel3: TPanel;
    Label1: TLabel;
    DBEdit1: TDBEdit;
    procedure edtWebLinkKeyPress(Sender: TObject; var Key: Char);
    procedure edtWebLinkExit(Sender: TObject);
    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
    procedure tblArtikelAfterInsert(DataSet: TDataSet);
    procedure FormCreate(Sender: TObject);
  private
    procedure WebLinkValidate;
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmMain: TfrmMain;

implementation

{$R *.DFM}


procedure TfrmMain.edtWebLinkKeyPress(Sender: TObject; var Key: Char);

begin
  if Key = #13 then
    Key := #0;
end;

procedure TfrmMain.edtWebLinkExit(Sender: TObject);
begin
  WebLinkValidate;
end;

procedure TfrmMain.WebLinkValidate;
var
  s: string;
begin
  if dsArtikel.State in dsEditModes then
  begin
    s := tblArtikelWebLink.AsString;
    //RFMakeCorrectWebLink(s);
    if s <> tblArtikelWebLink.AsString then
    begin
      if s = '' then
        tblArtikelWebLink.Clear
      else
        tblArtikelWebLink.AsString := s;
    end;
  end;
end;




procedure TfrmMain.FormCloseQuery(Sender: TObject; var CanClose: 
Boolean);
begin
  if tblArtikel.Active then
    tblArtikel.FlushBuffers;
end;

procedure TfrmMain.tblArtikelAfterInsert(DataSet: TDataSet);
begin
  tblArtikelInfo.Clear;
end;

procedure TfrmMain.FormCreate(Sender: TObject);
begin
  if not tblArtikel.Exists then
    tblArtikel.CreateTable;
  tblArtikel.Open;
end;

end.




Resolution Resolution
Fixed Problem on 4/8/2003 in version 3.25 build 1
Image