Problem using BLOB fields in MySQL with DBExpress

Hello

I am using MySQL v.3.23.49 with DBExpress on Win2000.
I managed to get Libmysql.dll from that distribution to work with
Delphi UpdatePack 1 (by switching to dbexpmysql.dll instead of
dbexpmys.dll). I cannot use UpdatePack 2 since I am working with a
german version, which is definitifely crashing after the Pack2
installation.

So far, everything just works fine. Since I started to use BLOB fields
in the DB and retrieving them with a TSQLDataSet component, I get an
EInvalidPointer exception when _closing_ the DataSet. But, and this is
really weird, not all the time. Sometimes its working, sometimes not.
If not, it crashes in TCustomSQLDataSet.FreeBuffers which is called by
TCustomSQLDataSet.InternalClose in the unit SQLExpr.pas. There it comes
to the line

procedure TCustomSQLDataSet.FreeBuffers;
begin
  if FBlobBuffer <> nil then
    SetLength(FBlobBuffer, 0);      // EInvalidPointer Exception

When I check that FBlobBuffer variable, it seems to be assigned
correctly and Length(FBlobBuffer) gives a reasonable value of 20, which
is about the size of the BLOB field contents I use.

Any ideas what could happen here? By the way, this is also happening
when using the old libmysql.dll from distribution 3.22 together with
dbexpmys.dll.

It drives me crazy, I cannot continue my work, because I need these
blob fields.

Maybe you want to see the code from where it all started:

with DataSystem do begin
    SystemDataSet.CommandText:='SELECT StrVal, BlobVal FROM SYSTEM
WHERE Param=:Param';
    SystemDataSet.Params[0].AsString:='DEFUSER';
    SystemDataSet.Active:=true;
    if not SystemDataSet.Eof then begin
      UserManager.Login:=SystemDataSet.Fields[0].AsString;
      UserManager.PW:=SystemDataSet.Fields[1].AsString;
        // this is legal for BLOBs !
    end;
      // here it crashes, but only when using the BLOB in SQL
    SystemDataSet.Active:=false;
  end;

First I used SystemDataSet.Open and Close instead of
Active:=true/false. When I changed it, everything seemed to work fine,
but then, after adding some lines of code somewhere else, it happened
again!

I know about the problems which arise when using MySQL v.3.23 with
DBExpress. But according to the release notes of Borlands UpdatePack1
the new driver dbexpmysql.dll has specific support for mysql 3.23.

Any help would be appreciated much! Thank you

Roger Stocker