Subject | Re: [IBO] retrieving a blob field |
---|---|
Author | peter@cyionics.com |
Post date | 2003-05-24T13:47:30Z |
Thanks markus that worked fine,
Just for the benefit of anybody else here is the completed code for loading TChart data from a blob field.
I also had to set the storage.position value to zero before doing anything with it.
procedure TMainForm.LoadChart;
Var
TemplateChart : TChart;
Storage : TMemoryStream;
begin
try
Storage := TMemoryStream.create;
TemplateChart.Free;
TemplateChart := TChart.Create(Self);
// Storage should be loaded here with the blobfield
IB_Query_Templates.FieldByName('TEMPLATE').Assignto(Storage);
Storage.Position := 0;
LoadChartFromStream( TCustomChart( TemplateChart ),Storage);
Storage.Position := 0;
Memo1.Lines.LoadFromStream(Storage);
TemplateChart.Parent := PanelBox;
TeeCommander1.Panel := TemplateChart;
Finally
Storage.Free;
end;
end;
Just for the benefit of anybody else here is the completed code for loading TChart data from a blob field.
I also had to set the storage.position value to zero before doing anything with it.
procedure TMainForm.LoadChart;
Var
TemplateChart : TChart;
Storage : TMemoryStream;
begin
try
Storage := TMemoryStream.create;
TemplateChart.Free;
TemplateChart := TChart.Create(Self);
// Storage should be loaded here with the blobfield
IB_Query_Templates.FieldByName('TEMPLATE').Assignto(Storage);
Storage.Position := 0;
LoadChartFromStream( TCustomChart( TemplateChart ),Storage);
Storage.Position := 0;
Memo1.Lines.LoadFromStream(Storage);
TemplateChart.Parent := PanelBox;
TeeCommander1.Panel := TemplateChart;
Finally
Storage.Free;
end;
end;
----- Original Message -----
From: Markus Ostenried
To: IBObjects@yahoogroups.com
Cc: peter@...
Sent: Saturday, May 24, 2003 1:43 PM
Subject: Re: [IBO] retrieving a blob field
Peter,
have you tried using AssignTo ?
e.g. IB_Query_Templates.FieldByName('TEMPLATE').AssignTo(Storage);
You said "text blob" - with IBObjects you can read/write columns defined as
"MemoColumn BLOB SUB_TYPE TEXT" using FieldByName('MemoColumn').AsString.
Also have a look at the example code in the help for
TIB_Statement.CreateBlobStream.
HTH,
Markus
Yahoo! Groups Sponsor
___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[Non-text portions of this message have been removed]