General SQL error with image BLObs, MSSQL+D4+BDE 5.01

I'm experiencing problems with image BLObs in Delphi 4 and BDE 5.0/MSSQL
(SQL Server 6.5).

First of all, MSSQL doesn't accept BLObs larger than about 64KB (not 32KB
as some documentation I've been able to dig up says) without passing BLOB
SIZE=xxx to the BDE driver, or it will fail with "Invalid BLOB length".

Having overcome this problem, I still don't get image BLObs to work.
With ODBC it works fine but is, of course, moving at tortoise speed most
of the time, and there are other problems with using ODBC; I want to
avoid that at all cost.

The BDE error I get when posting a record containing two BLOb fields with
some small amount of data is "General SQL error". Not very helpful.

The BLOb data seems to be stored despite the error message, because
subsequent accesses on the row that was posted will result in the same

The exception is raised inside TBlobStream.Create. The DBI error that
fails is DbiOpenBlob(). The error code is 13059.

With MSSQL I'm also experiencing a "duplicate row" problem. Even without
cached updates data-aware controls such as the DBGrid seems to be caching
data when dealing with tables containing an MSSQL "identity" column --
the net effect is that, when inserting and posting record, the control
will actually display two identical rows (one with an empty value in the
identity field, one with the correct value). Actually, I'm not at all
sure that this doesn't happen _without_ an identity field. I presume this
is a bug.

Alexander Staubo