🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.delphi.database
Article #225

External Exception EEFFACE - Solution???

#225
From: Jim Rutiger
Date: Fri, 24 May 2002 01:05
65 lines
2985 bytes
I was getting a "External Exception EEFFACE" when doing an ADD or an
UPDATE to a memo field on an AccessDB when the text was greater then
255 characters.  Searching through the newsgroups it seems that many
others have this problem, but I could not find any solutions.  There
were a few replies talking about making a change to the registry
(Image file executable options etc) but this did not solve my problem.

To get it to work I changed my code from:

-----------------------------------------

  // exception occues when memo fields greater then 255 chars
  with TQuery.Create(nil) do
  try
    DatabaseName := self.Database.DatabaseName;
    SQL.Text := 'UPDATE SavedBusinessObjects SET ObjectName =
:pObjectName, ObjectID = :pObjectID, BusinessObjectType =
:pBusinessObjectType, Elements = :pElements, Conditions = :pConditions
WHERE ID = :pID';
    ParamByName('pObjectName').AsString := self.ObjectName;
    ParamByName('pObjectID').AsString := self.ObjectID;
    ParamByName('pBusinessObjectType').AsString :=
self.BusinessObjectType.Name;
    ParamByName('pElements').AsMemo := self.Elements.Text;
    ParamByName('pConditions').AsMemo := self.Conditions.Text;
    ParamByName('pID').AsInteger := self.ID;

    ExecSQL;

    Result := True;
  finally
    Free;
  end;

-----------------------------------------

to:

-----------------------------------------

  // memo fields greater then 255 chars work!!!
  with TTable.Create(nil) do
  try
    DatabaseName := self.Database.DatabaseName;
    TableName := 'SavedBusinessObjects';
    Filtered := True;
    Filter := Format('ID = %d', [self.Id]);
    Open;

    Edit;
    FieldByName('ObjectName').AsString := self.ObjectName;
    FieldByName('ObjectID').AsString := self.ObjectID;
    FieldByName('BusinessObjectType').AsString :=
self.BusinessObjectType.Name;
    FieldByName('Elements').AsString := self.Elements.Text;
    FieldByName('Conditions').AsString := self.Conditions.Text;
    Post;
    Result := True;
  finally
    Free;
  end;

-----------------------------------------

A bit bodgy I know, but it works.  I hope this helps......
Technical Details
Message-ID: <c544ef81.0205231705.345c3438@posting.google.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 115d96,af7031b3a7ce1e84,start
X-Google-Attributes: gid115d96,public
X-Google-ArrivalTime: 2002-05-23 18:05:50 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mail
From: rutigerwolf@yahoo.com.au (Jim Rutiger)
Newsgroups: borland.public.delphi.database
Subject: External Exception EEFFACE - Solution???
Date: 23 May 2002 18:05:50 -0700
Organization: http://groups.google.com/
Lines: 65
Message-ID: <c544ef81.0205231705.345c3438@posting.google.com>
NNTP-Posting-Host: 203.102.38.135
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1022202350 25993 127.0.0.1 (24 May 2002 01:05:50 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: 24 May 2002 01:05:50 GMT