Dynamic SQL with TBytesField?



When connecting to a SQL Server database with ADO a TIMESTAMP field appears
in the dataset as type TBytesField.

All I want to do is save it in a variable and use it when generating an
UPDATE statement.

Can anyone give me an example of how to use a TBytesField and to store it
presumably to a variable of type TByteArray? Also how can I render that
byte array as a string - I see this following SQL statement works fine for
me so I would just like to transform it to a string.

update fw_entitytables
SET TableName = 'TranDates'
where EntityTableID = 202
and RowVersion = 0x000000000000D481

I thought maybe something like this but can't get it to work.
var ByteArray : TByteArray
begin
i := 0;
s := '0x';
while i < ByteArray do begin
s := s + char(ByteArray[i]);
end;
end;

Any basic help on ByteArrays and TBytesField would be really appreciated!

kind regards,
Paul Ritchie.


.