-
August 15th, 2016, 05:39 PM
#1
Convert Delphi code to VB6
Hi All,
Please I need your help, it's been a long time since my last vb6 programming. And, now I'm going to develop a program for Fingerprint reader ZK9000 from ZKsoftware with SDK from UrU 4500 model which I downloaded from the company's website. I was stuck on how to verify the Fingerprint that was saved on access DB. I did all my research but unfortunately I got nothing. But, on the other hand I saw an example code on SDK but it was written on Delphi,CB:
Can somebody convert this code for me from Delphi,CB to VB6.
procedure TFPProcess.SaveFPData(AQuery: TADOQuery; AFingerID: Integer; AFPData: OleVariant);
var pData: PChar;
begin
with AQuery do begin
Close;
SQL.Clear;
SQL.Add('SELECT * FROM zkFingerPrint WHERE FingerID = ' + IntToStr(AFingerID));
Open;
if IsEmpty then
Append
else
Edit;
FieldByName('FingerID').Value := AFingerID;
//Save the fingerprint template
with TBlobStream(CreateBlobStream(FieldByName('Template'), bmWrite)) do begin
pData := VarArrayLock(AFPData);
try
Write(pData^, VarArrayHighBound(AFPData, 1) - VarArrayLowBound(AFPData, 1) + 1);
finally
VarArrayUnlock(AFPData);
end;
Free;
end;
Post;
Close;
end;
end;
Procedure TFPProcess.GetFPData(AQuery: TADOQuery; AFingerID: Integer; var AFPData: OleVariant);
var pData: PChar;
begin
with AQuery do begin
Close;
SQL.Clear;
SQL.Add('SELECT * FROM zkFingerPrint WHERE FingerID = ' + IntToStr(AFingerID));
Open;
//read-out data
if not IsEmpty then
with TBlobStream(CreateBlobStream(FieldByName('Template'), bmRead)) do begin
AFPData := VarArrayCreate([0, Size + 1], varByte);
pData := VarArrayLock(AFPData);
try
Read(pData^, Size);
finally
VarArrayUnlock(AFPData);
end;
Free;
end;
Close;
end;
end;
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|