Autor Beitrag
day
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 107



BeitragVerfasst: So 01.08.04 16:53 
Hallo

Wie kann ich ein Blobstream den ich aus der datenbank geladen habe in einen OLEContainer einfügen?

habe es so probiert klappt allerdings nicht ganz

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
procedure TForm1.Button1Click(Sender: TObject);
var
Stream : TStream;
Fieldname : TBlobField;
begin

  Fieldname := Table1.FieldByName('TEXTMODULE') AS TBlobField;
  //Stream.Create(Fieldname  , bmRead);
  Stream := TBLOBStream( Query1.CreateBlobStream(Fieldname,bmRead));
  OleContainer1.LoadFromStream(Stream);
.
.
.

Moderiert von user profile iconPeter Lustig: Code- durch Delphi-Tags ersetzt.
Udontknow
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2596

Win7
D2006 WIN32, .NET (C#)
BeitragVerfasst: Di 10.08.04 14:52 
Was heisst "klappt nicht ganz"?

Probiere es doch mal so:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
procedure TForm1.Button1Click(Sender: TObject);  
var  
Stream : TMemoryStream;  
Field : TBlobField;  
begin  
  Field := Table1.FieldByName('TEXTMODULE') AS TBlobField;  
  Stream:=TMemoryStream.Create;
  try
    Field.SaveToStream(Stream);
    Stream.Position:=0;
    OleContainer1.LoadFromStream(Stream);
  finally
    Stream.Free;
  end;
end;


Cu,
Udontknow