D
delphi3_boy
Unregistered / Unconfirmed
GUEST, unregistred user!
出现个问题,请问为什么,点完保存,就不能点读取了呢?或点完读取就不能点保存了呢?
代码如下
保存的: var sql:string; str1:TMemoryStream;
begin
sql:='select * from a';
adoquery1.Close;
adoquery1.sql.add(sql);
adoquery1.Open;
adoquery1.First;
str1:=TMemoryStream.Create();
OleContainer1.SaveToStream(str1);
str1.Position:=0;
adoquery1.edit;
TBlobField(adoquery1.fieldbyname('word')).LoadFromStream(str1);
adoquery1.Post;
str1.Free;
OleContainer1.Close;
end;
读取的:var sql:string; str:TMemoryStream;
begin
sql:='select * from a';
adoquery1.Close;
adoquery1.sql.add(sql);
adoquery1.Open;
//adoquery1.Edit;
str:=TMemoryStream.Create();
TBlobField(adoquery1.fieldbyname('word')).SaveToStream(str);
str.position:=0;
OleContainer2.LoadfromStream(str);
str.Free;
end;
代码如下
保存的: var sql:string; str1:TMemoryStream;
begin
sql:='select * from a';
adoquery1.Close;
adoquery1.sql.add(sql);
adoquery1.Open;
adoquery1.First;
str1:=TMemoryStream.Create();
OleContainer1.SaveToStream(str1);
str1.Position:=0;
adoquery1.edit;
TBlobField(adoquery1.fieldbyname('word')).LoadFromStream(str1);
adoquery1.Post;
str1.Free;
OleContainer1.Close;
end;
读取的:var sql:string; str:TMemoryStream;
begin
sql:='select * from a';
adoquery1.Close;
adoquery1.sql.add(sql);
adoquery1.Open;
//adoquery1.Edit;
str:=TMemoryStream.Create();
TBlobField(adoquery1.fieldbyname('word')).SaveToStream(str);
str.position:=0;
OleContainer2.LoadfromStream(str);
str.Free;
end;