Page 1 of 1

Biometric issues

PostPosted: February 2nd, 2007, 10:29 pm
by mdomeyko2
Im working with DigitalPersona and I need to put an OleVariant object (the given digital fingerprint sample) into a blob field but it gives an conversion error, so I need to convert Olevariant into some string or other so I can save it on a blob field. Real need it ASAP. :!:

PostPosted: February 3rd, 2007, 4:42 pm
by Kambiz
Try to assign the OleVariant to a Variant variable, and then assign the Variant to the blob field. For retrieving the OleVariant, do the procedure in reverse.

OleVariant to blob field

PostPosted: February 5th, 2007, 4:58 pm
by mdomeyko2
I'v tried this procedure, but I don't know how to write the results to a blob field...

Code: Select all
procedure TfrmMgrMenuFingerPrtReg.FPRegisterTemplate1Done(Sender: TObject; var pTemplate: OleVariant);
var l_val    : OleVariant;
    l_pArray : PSafeArray;
           i : integer;
    fpBuffer : PByteArray;
    bblob    : Tblob;
begin
     pTemplate.Export(l_val);
     l_pArray := PSafeArray(TVarData(l_val).VArray);
     blobSize := l_pArray.rgsabound[0].cElements * l_pArray.cbElements;
     fpBuffer := VarArrayLock(l_val);
     for i := 0 to blobSize - 1 do
         fpData[i] := fpBuffer[i];     //pvData is byte array
     VarArrayUnlock(l_val);

    q_upd_fingerpool.parambyname('fingerPrint').asblob  := ????? //<= hera isa da problema
:(

//Edited by J_B with reason: argh! my f***ing eyes!

PostPosted: February 5th, 2007, 10:27 pm
by Kambiz
Did you try this?

Code: Select all
procedure TfrmMgrMenuFingerPrtReg.FPRegisterTemplate1Done(Sender: TObject;
  var pTemplate: OleVariant);
begin
   q_upd_fingerpool.ParamByName('fingerPrint').AsVariant := pTemplate;
end

Olevariant to blob field

PostPosted: February 6th, 2007, 4:13 pm
by mdomeyko2
Yes, I tried that but it gives a "invalid variant type conversion error"..
Im going to try writing it to a temp file, then read it back using stream.., but I hate the idea of doing that, if it works...
There must be something better! :?

PostPosted: February 6th, 2007, 6:15 pm
by Kambiz
Instead of using a temporary file, you can write in to a blob stream.
By the way, which database you use?

Olevariant to blob

PostPosted: February 6th, 2007, 8:21 pm
by mdomeyko2
Im using D6 & Firebird 1.5

PostPosted: February 12th, 2007, 12:16 am
by kokkoras
If memory serves well, it is not possible to convert a variant to anything you like. There are some limitations (described in the HELP).