P
psynet123
Unregistered / Unconfirmed
GUEST, unregistred user!
var
recsout,i: integer;
arraybin:TAriantArray;
oledata:OleVariant;
zStream:TZCompressionStream;
sMemstream,dectStream,ss:TMemoryStream;
b:TMemoryStream;
icount:Int64;
sbuffChar;
unstream:TZDecompressionStream;
begin
try
try
sMemstream:=TMemoryStream.Create; dectStream:=TMemoryStream.Create;
arraybin:=TAriantArray.Create;
// ListObj.Add(arraybin) ;
ServerForm.Memo3.Lines.Clear;
for i:=0 to sSQL.Count-1 do
begin
// sqlQuery1
with SimpleDataSet1 do
begin
ServerForm.Memo3.Lines.Add(IntToStr(GetTickCount));
Close;
// SQL.Clear;
// sql.Add(sSQL.Items);
DataSet.CommandText:=sSQL.Items;
Open;
ServerForm.Memo3.Lines.Add(IntToStr(GetTickCount));
// sMemstream.Position:=0;
zStream:=TZCompressionStream.Create(dectStream,zcFastest);
SaveToStream(sMemstream);
icount:=sMemstream.Size;
ServerForm.Memo3.Lines.Add(IntToStr(sMemstream.Size)+'k1');
sMemstream.SaveToStream(zStream);
sMemstream.Clear;
dectStream.Position:=0;
sMemstream.Position:=0;
// sMemstream.WriteBuffer(icount,SizeOf(icount)) ;
sMemstream.CopyFrom(dectStream,0) ;
//------------------------------------------------------------
// sMemstream.Position:=0;
icount:=0;
// sMemstream.ReadBuffer(iCount, SizeOf(iCount));
//GetMem(sbuff,icount);
ServerForm.Memo3.Lines.Add(IntToStr(sMemstream.Size)+'k2');
ss:=TMemoryStream.Create;
ServerForm.Memo3.Lines.Add(IntToStr(1));
// dectStream.Position:=0;
ServerForm.Memo3.Lines.Add(IntToStr(2));
sMemstream.Position:=0;
unstream:=TZDecompressionStream.Create(sMemstream);
ServerForm.Memo3.Lines.Add(vartostr(unstream.Size)+'k3');
ServerForm.Memo3.Lines.Add(IntToStr(3));
//unstream.ReadBuffer(sbuff^,SizeOf(icount));
ServerForm.Memo3.Lines.Add(IntToStr(4));
//ss.WriteBuffer(sbuff^,icount);
ServerForm.Memo3.Lines.Add(IntToStr(5));
// ss.Position:=0;
unstream.Position:=0;
ss.CopyFrom(unstream,0) ;
ServerForm.Memo3.Lines.Add(IntToStr(6));
//ss.WriteBuffer(sbuff^,icount);
ss.Position:=0;
ss.SaveToFile('dddddddddd');
// SimpleDataSet2.Close;
SimpleDataSet2.LoadFromFile('dddddddddd');
// SimpleDataSet2.LoadFromStream(ss);
ServerForm.Memo3.Lines.Add(IntToStr(7));
//---------------------------------------------------------
//zStream.Write(sMemstream,SizeOf(sMemstream));
// .save
// oledata:=DataSetProvider.Data;
oledata:=SimpleDataSet2.Data;
ServerForm.Memo3.Lines.Add(IntToStr(GetTickCount));
arraybin.add(BinaryFromVariant(oledata));
// TROBinaryMemoryStream
// arraybin.add(sMemstream);
ServerForm.Memo3.Lines.Add(IntToStr(GetTickCount));
Close;
end ;
//dbexpmss.dll
end;
recsout,i: integer;
arraybin:TAriantArray;
oledata:OleVariant;
zStream:TZCompressionStream;
sMemstream,dectStream,ss:TMemoryStream;
b:TMemoryStream;
icount:Int64;
sbuffChar;
unstream:TZDecompressionStream;
begin
try
try
sMemstream:=TMemoryStream.Create; dectStream:=TMemoryStream.Create;
arraybin:=TAriantArray.Create;
// ListObj.Add(arraybin) ;
ServerForm.Memo3.Lines.Clear;
for i:=0 to sSQL.Count-1 do
begin
// sqlQuery1
with SimpleDataSet1 do
begin
ServerForm.Memo3.Lines.Add(IntToStr(GetTickCount));
Close;
// SQL.Clear;
// sql.Add(sSQL.Items);
DataSet.CommandText:=sSQL.Items;
Open;
ServerForm.Memo3.Lines.Add(IntToStr(GetTickCount));
// sMemstream.Position:=0;
zStream:=TZCompressionStream.Create(dectStream,zcFastest);
SaveToStream(sMemstream);
icount:=sMemstream.Size;
ServerForm.Memo3.Lines.Add(IntToStr(sMemstream.Size)+'k1');
sMemstream.SaveToStream(zStream);
sMemstream.Clear;
dectStream.Position:=0;
sMemstream.Position:=0;
// sMemstream.WriteBuffer(icount,SizeOf(icount)) ;
sMemstream.CopyFrom(dectStream,0) ;
//------------------------------------------------------------
// sMemstream.Position:=0;
icount:=0;
// sMemstream.ReadBuffer(iCount, SizeOf(iCount));
//GetMem(sbuff,icount);
ServerForm.Memo3.Lines.Add(IntToStr(sMemstream.Size)+'k2');
ss:=TMemoryStream.Create;
ServerForm.Memo3.Lines.Add(IntToStr(1));
// dectStream.Position:=0;
ServerForm.Memo3.Lines.Add(IntToStr(2));
sMemstream.Position:=0;
unstream:=TZDecompressionStream.Create(sMemstream);
ServerForm.Memo3.Lines.Add(vartostr(unstream.Size)+'k3');
ServerForm.Memo3.Lines.Add(IntToStr(3));
//unstream.ReadBuffer(sbuff^,SizeOf(icount));
ServerForm.Memo3.Lines.Add(IntToStr(4));
//ss.WriteBuffer(sbuff^,icount);
ServerForm.Memo3.Lines.Add(IntToStr(5));
// ss.Position:=0;
unstream.Position:=0;
ss.CopyFrom(unstream,0) ;
ServerForm.Memo3.Lines.Add(IntToStr(6));
//ss.WriteBuffer(sbuff^,icount);
ss.Position:=0;
ss.SaveToFile('dddddddddd');
// SimpleDataSet2.Close;
SimpleDataSet2.LoadFromFile('dddddddddd');
// SimpleDataSet2.LoadFromStream(ss);
ServerForm.Memo3.Lines.Add(IntToStr(7));
//---------------------------------------------------------
//zStream.Write(sMemstream,SizeOf(sMemstream));
// .save
// oledata:=DataSetProvider.Data;
oledata:=SimpleDataSet2.Data;
ServerForm.Memo3.Lines.Add(IntToStr(GetTickCount));
arraybin.add(BinaryFromVariant(oledata));
// TROBinaryMemoryStream
// arraybin.add(sMemstream);
ServerForm.Memo3.Lines.Add(IntToStr(GetTickCount));
Close;
end ;
//dbexpmss.dll
end;