Issue with updating blob field
Posted: 28.03.2006, 15:24
Hi,
I have used zeolibs for a couple of years now and it works very well. I use it to connect with our sql-servers and have never had any problems before now...
I have created a new database with a table that contains an Image field called Picture. I have tried a lot of ways to get this field updated, but somehow it never does. Does anyone have any idea of way? Other fields updates just fine except this one. Here`s what I have done that doesn`t update the field...
var
imStream:TStream;
begin
sqlQuery.SQL.Text:='SELECT * FROM ModelTypes WHERE IndexID = '+IntToStr(ID);
with dsSQL.Dataset do
begin
Edit;
imStream := CreateBlobStream(FieldByName('Picture'),bmWrite);
Image1.Picture.Bitmap.SaveToStream(imStream);
Post;
end;
end;
I recieve no errors during this operation. It just doesn`t update it... I also updates other fields in the same code that updates fine.
I have used zeolibs for a couple of years now and it works very well. I use it to connect with our sql-servers and have never had any problems before now...
I have created a new database with a table that contains an Image field called Picture. I have tried a lot of ways to get this field updated, but somehow it never does. Does anyone have any idea of way? Other fields updates just fine except this one. Here`s what I have done that doesn`t update the field...
var
imStream:TStream;
begin
sqlQuery.SQL.Text:='SELECT * FROM ModelTypes WHERE IndexID = '+IntToStr(ID);
with dsSQL.Dataset do
begin
Edit;
imStream := CreateBlobStream(FieldByName('Picture'),bmWrite);
Image1.Picture.Bitmap.SaveToStream(imStream);
Post;
end;
end;
I recieve no errors during this operation. It just doesn`t update it... I also updates other fields in the same code that updates fine.