procedure TForm1.HQSJClick(Sender: TObject);
var
Mac_Tmp, Card_Tmp, Cnt_Tmp, Level_Tmp, Pass_Tmp: Integer;
Data_Tmp: OleVariant;
Str_Tmp: TBlobStream;
p: Pointer;
L : Integer;
begin
try
Mac_Tmp:=StrToInt(Trim(Edit4.Text));
except
Mac_Tmp:=1;
end;
try
Card_Tmp:=StrToInt(Trim(Edit7.Text));
except
Card_Tmp:=1;
end;
try
Cnt_Tmp:=StrToInt(Trim(Edit8.Text));
except
Cnt_Tmp:=1;
end;
FK524PXN1.GetEnrollData(Mac_Tmp,Card_Tmp,Cnt_Tmp, Level_Tmp, Data_Tmp, Pass_Tmp);
Edit9.Text:=IntToStr(Level_Tmp);
Edit10.Text:=IntToStr(Pass_Tmp);
if A_C.Active then
A_C.Close;
A_C.Parameters.ParamByName('CardNo').Value:=Card_Tmp;
A_C.Parameters.ParamByName('ZWID').Value:=Cnt_Tmp;
A_C.Open;
if A_C.RecordCount<1 then
begin
A_C.Append;
A_C.FieldByName('CardNo').AsInteger:=Card_Tmp;
A_C.FieldByName('ZWID').AsInteger:=Cnt_Tmp;
A_C.Post;
end;
if A_C.Active then
A_C.Close;
A_C.Parameters.ParamByName('CardNo').Value:=Card_Tmp;
A_C.Parameters.ParamByName('ZWID').Value:=Cnt_Tmp;
A_C.Open;
A_C.Edit;
try
Str_Tmp:=TBlobStream.Create(A_C.FieldByName('TXBM') as TBlobField,bmWrite);
L := VarArrayHighBound(Data_Tmp, 1) - VarArrayLowBound(Data_Tmp, 1) + 1;
p := VarArrayLock(Data_Tmp);
Str_Tmp.Seek(0, soFromBeginning);
Str_Tmp.WriteBuffer(p^, L);
finally
VarArrayUnlock(Data_Tmp);
end;
A_C.Post;
//TBlobField(A_C.FieldByName('TXBM')).LoadFromStream(Str_Tmp);
end;
TXBM是binary类型
出现Invalid argument的错误,请问下应该怎样修改这段代码