W
wisdomphg
Unregistered / Unconfirmed
GUEST, unregistred user!
怎样才能把MEMO里面,从串口收集来的数据转到SQL SERVER2000里面,我有一个用SPCOMM控件的收集程序,却不知怎样把数据实时保存下来。
procedure TForm1.Comm1ReceiveData(Sender: TObject;
Buffer: Pointer;
BufferLength: Word);
var
tmpArray:array[0..4096] of Byte;
ArraySize,i: DWORD;
CountWORD;
tmpStr:string;
pStrChar;
begin
if Check1.Checked then
begin
pStr:=Buffer;
tmpStr:=string(pStr);
Dec(PStr);
for i:=0 to Length(tmpStr)-1do
begin
inc(PStr);
tmpArray:=Byte(PSTR^);
Memo2.Lines.Add(IntToHEX(Ord(tmpArray),2));
end;
exit;
end;
pStr:= Buffer;
memo2.Lines.Add(pStr);
end;
procedure TForm1.Comm1ReceiveData(Sender: TObject;
Buffer: Pointer;
BufferLength: Word);
var
tmpArray:array[0..4096] of Byte;
ArraySize,i: DWORD;
CountWORD;
tmpStr:string;
pStrChar;
begin
if Check1.Checked then
begin
pStr:=Buffer;
tmpStr:=string(pStr);
Dec(PStr);
for i:=0 to Length(tmpStr)-1do
begin
inc(PStr);
tmpArray:=Byte(PSTR^);
Memo2.Lines.Add(IntToHEX(Ord(tmpArray),2));
end;
exit;
end;
pStr:= Buffer;
memo2.Lines.Add(pStr);
end;