Biometric issues

Please discuss general Delphi programming topics here.

Biometric issues

Postby mdomeyko2 » February 2nd, 2007, 10:29 pm

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. :!:
Canguro
Miami, FL
mdomeyko2
Active Member
Active Member
 
Posts: 11
Joined: September 18th, 2006, 10:06 pm

Postby Kambiz » February 3rd, 2007, 4:42 pm

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.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2424
Joined: March 7th, 2003, 7:10 pm

OleVariant to blob field

Postby mdomeyko2 » February 5th, 2007, 4:58 pm

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!
Canguro
Miami, FL
mdomeyko2
Active Member
Active Member
 
Posts: 11
Joined: September 18th, 2006, 10:06 pm

Postby Kambiz » February 5th, 2007, 10:27 pm

Did you try this?

Code: Select all
procedure TfrmMgrMenuFingerPrtReg.FPRegisterTemplate1Done(Sender: TObject;
  var pTemplate: OleVariant);
begin
   q_upd_fingerpool.ParamByName('fingerPrint').AsVariant := pTemplate;
end
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2424
Joined: March 7th, 2003, 7:10 pm

Olevariant to blob field

Postby mdomeyko2 » February 6th, 2007, 4:13 pm

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! :?
Canguro
Miami, FL
mdomeyko2
Active Member
Active Member
 
Posts: 11
Joined: September 18th, 2006, 10:06 pm

Postby Kambiz » February 6th, 2007, 6:15 pm

Instead of using a temporary file, you can write in to a blob stream.
By the way, which database you use?
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2424
Joined: March 7th, 2003, 7:10 pm

Olevariant to blob

Postby mdomeyko2 » February 6th, 2007, 8:21 pm

Im using D6 & Firebird 1.5
Canguro
Miami, FL
mdomeyko2
Active Member
Active Member
 
Posts: 11
Joined: September 18th, 2006, 10:06 pm

Postby kokkoras » February 12th, 2007, 12:16 am

If memory serves well, it is not possible to convert a variant to anything you like. There are some limitations (described in the HELP).
Fotis
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece


Return to Delphi Programming

Who is online

Users browsing this forum: No registered users and 3 guests

cron