Results 1 to 4 of 4

Thread: Can Somebody convert below code snippet to vb6

  1. #1

    Thread Starter
    Registered User
    Join Date
    Mar 2017
    Posts
    1

    Can Somebody convert below code snippet 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;

  2. #2
    Wall Poster TysonLPrice's Avatar
    Join Date
    Sep 2002
    Location
    Columbus, Ohio
    Posts
    3,836

    Re: Can Somebody convert below code snippet to vb6

    How much are you paying?
    Please remember next time...elections matter!

  3. #3
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: Can Somebody convert below code snippet to vb6

    The code isn't doing much anyway. Two trivial procedures wrapping two poorly-formed database queries. Seriously, "SELECT *" when you only want to twiddle one field?

    Not much here to do if the rest of the program has been translated already.
    Last edited by dilettante; Mar 15th, 2017 at 09:35 AM.

  4. #4
    Junior Member
    Join Date
    Jul 2016
    Posts
    28

    Re: Can Somebody convert below code snippet to vb6

    If you are trying to connect MySQL with VB6 then you need to use the Microsoft ActiveX Data Objects 2.8 Library.
    Check this: http://stackoverflow.com/questions/7...visual-basic-6

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