Subject Using rdb$db_key with IBO
Author Svein Erling Tysvær
Making myself a little tool, I discovered a problem assigning rdb$db_key to a parameter. Basically, what I've got, is one TIB_Cursor that selects rdb$db_key, and then a TIB_DSQL that tries to update the same record using this rdb$db_key. Doing



TIB_DSQL1.Params[1].AsVariant:=TIB_Cursor1.Fields[0].AsVariant; //rdb$db_key



Assigns 'A1000000' to the parameter when the field contains 'A100000001000000', i.e. IBO trims away half the value! First I tried using .AsString, then changed to .AsVariant and then changed to IBO 4.8.7 (probably a beta version from 26 August 2007), but this behaviour was consistent. If it is of any relevance, I generally use ISO8859_1 as the character set and NO_NO as collation.



To me, it seems like the statement



if strLen > SQLLen then

strLen := SQLLen;



in TIB_ColumnText.SetValue shortens the string from 16 to 8 characters.



Any way to use rdb$db_key with IBO? Of course I normally have a primary key (PK) on my tables, but I would like this little tool to work even for tables that don't have a PK.



Using Borland Developer Studio 2006.



Thanks for any answers,

Set



[Non-text portions of this message have been removed]