陈
陈亮96
Unregistered / Unconfirmed
GUEST, unregistred user!
在Delphi5如何调用Access 中 OLE的Bmp字段
请看我使用的方法:
var st:Tstringstream;
blobstream:Tblobstream;
blobfield:Tblobfield;
begin
adodataset1.Open;
adodataset1.first;
st:=Tstringstream.Create('');
if adodataset1.Fields[5] is Tblobfield then
showmessage('Tblobfield');//显示.
blobfield:= adodataset1.fields[5] as Tblobfield ;//
如果去掉as Tblobfield则出现invalid class typecast错误
but adodataset1.fields[5] is Tblobfield=true
blobstream:=Tblobstream.Create(blobfield,bmwrite);//
编译到这出现错误 incompatible types:'TblobField'and'TField'.
st.CopyFrom(blobstream,blobstream.size);
st.Position:=0;
//olecontainer1.LoadFromStream(st);
image1.Picture.Graphic.LoadFromStream(st); ;
请看我使用的方法:
var st:Tstringstream;
blobstream:Tblobstream;
blobfield:Tblobfield;
begin
adodataset1.Open;
adodataset1.first;
st:=Tstringstream.Create('');
if adodataset1.Fields[5] is Tblobfield then
showmessage('Tblobfield');//显示.
blobfield:= adodataset1.fields[5] as Tblobfield ;//
如果去掉as Tblobfield则出现invalid class typecast错误
but adodataset1.fields[5] is Tblobfield=true
blobstream:=Tblobstream.Create(blobfield,bmwrite);//
编译到这出现错误 incompatible types:'TblobField'and'TField'.
st.CopyFrom(blobstream,blobstream.size);
st.Position:=0;
//olecontainer1.LoadFromStream(st);
image1.Picture.Graphic.LoadFromStream(st); ;