Hi,
I am using Delphi 2005,Richedit control..trying to save richedit control contents to access database and read from access database using ADO.
I have two questions..
Right now I am using Access 2003 and I am using field type as Memo to save richedit control contents. Can it store pictures too? Or I need to use Ole Object as field type?
I found this code on internet..giving me error Incompatible types 'TBlobfield' and 'Tstream'. Right now its just text I am trying to save.
procedure TForm1.UpdateBlob(IDValue:Integer);
var
blobF : TBlobField;
bs : TStream;
Local_dsLocal :TADODataSet;
begin
Local_dsLocal := GetADODataSet('Select * from TrDetail where id = ' +IntToStr(IDValue));
//blobF := Local_dsLocal.CreateBlobStream(Local_dsLocal.FieldByName('Contents'), bmWrite);
Local_dsLocal.Edit;
bs:=Local_dsLocal.CreateBlobStream(Local_dsLocal.FieldByName('Contents'),bmReadWrite);
rtbox.Lines.SaveToStream(bs);
Local_dsLocal.Post;
end;
What am I doing wrong? Any Idea?
Thank you for your help
I am using Delphi 2005,Richedit control..trying to save richedit control contents to access database and read from access database using ADO.
I have two questions..
Right now I am using Access 2003 and I am using field type as Memo to save richedit control contents. Can it store pictures too? Or I need to use Ole Object as field type?
I found this code on internet..giving me error Incompatible types 'TBlobfield' and 'Tstream'. Right now its just text I am trying to save.
procedure TForm1.UpdateBlob(IDValue:Integer);
var
blobF : TBlobField;
bs : TStream;
Local_dsLocal :TADODataSet;
begin
Local_dsLocal := GetADODataSet('Select * from TrDetail where id = ' +IntToStr(IDValue));
//blobF := Local_dsLocal.CreateBlobStream(Local_dsLocal.FieldByName('Contents'), bmWrite);
Local_dsLocal.Edit;
bs:=Local_dsLocal.CreateBlobStream(Local_dsLocal.FieldByName('Contents'),bmReadWrite);
rtbox.Lines.SaveToStream(bs);
Local_dsLocal.Post;
end;
What am I doing wrong? Any Idea?
Thank you for your help