Page 1 of 1

Blob will not set to NULL

Posted: Wed 03 Sep 2008 07:55
by fis_pelzer
Hi,

we use Delphi 7 and the SDAC Version 4.50.
We create a wrapper class the connect with the Database and this class has the property query with is a TMSQuery.
We

We use this code snippet to set a blob field to null

Code: Select all

tdataset(tmsquery).FieldByName("db_field_image_blob").SetData(nil);
And after that we do POST to the query.

With the ADO implementation of Delphi is works fine, but with the SDAC component the NULL value wouldn't set to the database.

Have enyone an idea, were the problem can be?

CU
Sven

Posted: Thu 04 Sep 2008 11:52
by Dimon
To set the NULL value in the Blob field, you should call the Clear method, like this:

Code: Select all

tmsquery.FieldByName("db_field_image_blob").Clear;