CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2016
    Posts
    2

    Can Somebody convert below code snippet to vb6

    Code:
    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;
    Code:
    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;
    Last edited by 2kaud; March 14th, 2017 at 02:04 PM. Reason: Added code tags

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Can Somebody convert below code snippet to vb6

    Well, if you know what this code is supposed to do then why don't you want to "convert" it yourself?
    Victor Nijegorodov

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured