H hongxing_dl Unregistered / Unconfirmed GUEST, unregistred user! 2005-04-04 #3 直接查询就到客户端了啊~~~ clientdataset/query/adoquery...都可以的啊
S someset Unregistered / Unconfirmed GUEST, unregistred user! 2005-04-04 #4 二进制返回,字段读出到流,用图像控件的LoadFromStream显示
B BallLeiJeff Unregistered / Unconfirmed GUEST, unregistred user! 2005-04-04 #5 someset,能否讲详细点? 中间层接口应该是用olevariant吧,怎样通过olevariant返回呢! 怎样将查询出来的图像转换成olevariant呢,谢谢
S someset Unregistered / Unconfirmed GUEST, unregistred user! 2005-04-04 #6 中间层没用过,大概也没有什么不同 字段数据类型是BINARY的吧, 想用OLEVARIANT的话一般直接赋值就行了,VARIANT变量类型会变成VarArray
迷 迷糊 Unregistered / Unconfirmed GUEST, unregistred user! 2005-04-04 #7 function streamtovar(stream:tstream:variant; var pointer; begin result:= VarArrayCreate([0, Stream.Size - 1], varByte); p:= VarArrayLock(result); try Stream.Position := 0; Stream.Read(p^, Stream.Size); finally VarArrayUnlock(result); end; end; function vartostream(filevar:variant;var stream:Tstream); var pointer; begin p := VarArrayLock(filevar); try Stream.Write(p^, VarArrayHighBound(filevar,1) + 1); finally VarArrayUnlock(filevar); end; end;
function streamtovar(stream:tstream:variant; var pointer; begin result:= VarArrayCreate([0, Stream.Size - 1], varByte); p:= VarArrayLock(result); try Stream.Position := 0; Stream.Read(p^, Stream.Size); finally VarArrayUnlock(result); end; end; function vartostream(filevar:variant;var stream:Tstream); var pointer; begin p := VarArrayLock(filevar); try Stream.Write(p^, VarArrayHighBound(filevar,1) + 1); finally VarArrayUnlock(filevar); end; end;