X
xiao_wen
Unregistered / Unconfirmed
GUEST, unregistred user!
我主要想把表中的两个字段合并,并能通过olecontainer显示出来。
其中ole为olecontainer。
Procedure OleFldUnited(var oleFldname1,oleFldname2: String;dataTable : TAdoTable;Ole: TOleContainer);
var
OleStream1,OleStream2,TestStream: Tstream;
UnitedStream : TMemorystream;
begin
UnitedStream := TMemorystream.Create ;
OleStream1 := dataTable.CreateBlobStream(dataTable.fieldbyName(oleFldname1),bmRead);
OleStream2 := dataTable.CreateBlobStream(dataTable.fieldbyName(oleFldName2),bmRead);
UnitedStream.Position :=0;
UnitedStream.CopyFrom(OleStream1,OleStream1.size);
UnitedStream.Position := UnitedStream.Size ;
//Showmessage('Dialog1: '+inttostr(UnitedStream.size));
UnitedStream.CopyFrom(oleStream2,oleStream2.size);
//Showmessage('Dialog2: '+inttostr(UnitedStream.size));
Ole.LoadFromStream(UnitedStream);
Ole.DoVerb(OvShow);
OleStream1.free;
OleStream2.free;
UnitedStream.Free ;
end;
代码都能通过编译通过,只是ole调用出来的却是第一olefldname1的内容。为什么呀。难道是word的
结束标记导致的吗? 还是stream也有结束标记而导致不能合并呀??? 希望各位高手赐教。
同时更请斑竹也帮我一个忙。
其中ole为olecontainer。
Procedure OleFldUnited(var oleFldname1,oleFldname2: String;dataTable : TAdoTable;Ole: TOleContainer);
var
OleStream1,OleStream2,TestStream: Tstream;
UnitedStream : TMemorystream;
begin
UnitedStream := TMemorystream.Create ;
OleStream1 := dataTable.CreateBlobStream(dataTable.fieldbyName(oleFldname1),bmRead);
OleStream2 := dataTable.CreateBlobStream(dataTable.fieldbyName(oleFldName2),bmRead);
UnitedStream.Position :=0;
UnitedStream.CopyFrom(OleStream1,OleStream1.size);
UnitedStream.Position := UnitedStream.Size ;
//Showmessage('Dialog1: '+inttostr(UnitedStream.size));
UnitedStream.CopyFrom(oleStream2,oleStream2.size);
//Showmessage('Dialog2: '+inttostr(UnitedStream.size));
Ole.LoadFromStream(UnitedStream);
Ole.DoVerb(OvShow);
OleStream1.free;
OleStream2.free;
UnitedStream.Free ;
end;
代码都能通过编译通过,只是ole调用出来的却是第一olefldname1的内容。为什么呀。难道是word的
结束标记导致的吗? 还是stream也有结束标记而导致不能合并呀??? 希望各位高手赐教。
同时更请斑竹也帮我一个忙。