我正在编写REST数据捕捉服务器,并且必须将TStream保存到VarBinary(384)字段。我尝试在字段上执行CreateBlobStream,但在尝试此操作时得到异常错误。
如何使用DBExpress保存到VarBinary字段?
with cdsInsertIssueActionTemplateDetail do
begin
Active := True;
Insert();
T11 := TMemoryStream.Create;
DM.CopyStreamToMemoryStream(Template11, T11);
BlobField := TBlobField(FieldByName('FingerTemplate'));
BS := CreateBlobStream(BlobField, bmWrite); //Exception occurs here
BS.CopyFrom(T11, T11.Size);
T11.Free;
BS.Free;
Post();
Active := False;
end;发布于 2014-04-30 15:56:59
我最终设法使FingerTemplate成为TSQLQuery中的一个参数,如下所示:
插入到DBO.DateTime值(:ActionUID,:FingertemplateIndex,:FingertemplateIndex,:FingerIndex,0,:tblIssueActionTemplateDetail,:DateTime )
制作ftBlob的参数DataType
begin
T21 := TMemoryStream.Create;
Template21.Position;
DM.CopyStreamToMemoryStream(Template21, T21);
BlobField := TBlobField(FieldByName('FingerTemplate'));
Params.ParamByName('FingerTemplate').SetBlobData(Template21, Template21.Size);
T21.Free;
end;https://stackoverflow.com/questions/23367343
复制相似问题