Subject How to build up TPB with IXpbBuilder properly?
Author Gabor Boros
Hi All,

The second code fragment works like a charm (the transaction started
properly with the given parametes). The first not and return this error
message:
"invalid format for transaction parameter block
-wrong version of transaction parameter block"

What's wrong with the IXpbBuilder?


*1*
var
TPB:IXpbBuilder;

begin
TPB:=util.getXpbBuilder(status,IXpbBuilder.TPB,nil,0);
TPB.insertTag(status,isc_tpb_version3);
TPB.insertTag(status,isc_tpb_read_committed);
TPB.insertTag(status,isc_tpb_no_rec_version);
TPB.insertTag(status,isc_tpb_wait);
TPB.insertTag(status,isc_tpb_write);

transaction:=attachment.startTransaction(status,TPB.getBufferLength(status),TPB.getBuffer(status));


*2*
var
TPB:array of Byte;

begin
SetLength(TPB, 5);
TPB[0]:=isc_tpb_version3;
TPB[1]:=isc_tpb_read_committed;
TPB[2]:=isc_tpb_no_rec_version;
TPB[3]:=isc_tpb_wait;
TPB[4]:=isc_tpb_write;
transaction:=attachment.startTransaction(status,Length(TPB),@TPB[0]);


Gabor