OleVariant To Byte(100分)

  • 主题发起人 主题发起人 NextTime
  • 开始时间 开始时间
N

NextTime

Unregistered / Unconfirmed
GUEST, unregistred user!
Please tell me what can I do ?
OleVariant To Byte
 
here is a sample:

function TSWSrv.FetchData(const SQL: WideString; var Params: OleVariant;
Compress: Shortint): OleVariant;
var
buff:Array of byte;
v:TParams;
begin
setsql(DataSet,Sql);
v:=TParams.Create;
try
v.ParseSQL(Sql,true);
UnpackParams(params,v);
setparams(DataSet,V);
if Compress=0 then
result:=Prov.Data
else
begin
buff:=Prov.Data;
GetParams(DataSet,v);
params:=PackageParams(v);
mem.Clear;
zip:=TCompressionStream.Create(cldefault,mem);
try
zip.Write(buff[0],high(Buff)+1);
finally
freeandnil(zip);
end;
setlength(buff,mem.size);
mem.Position:=0;
mem.Read(buff[0],mem.Size);
result:=buff;
end;
finally
V.Free;
DataSet.Close;
end;
end;
 
TParams类型从哪里来?还有一些其他的方法,好像都不明白哦。
djdsz能不能说得再明白一些呀。
 
后退
顶部