Tiago Moraes
Tiago Moraes

Reputation: 328

How to Compare TBlobField OldValue with Value

In Delphi 2010,

if Field.OldValue <> Field.Value then
...

raises the Exception:

raised exception class EVariantTypeCastError with message 'Could not convert variant of type (Array Byte) into type (Integer)'.

How can I know if a TBlobField value has changed?

Upvotes: 1

Views: 1270

Answers (2)

ManuelGomes
ManuelGomes

Reputation: 159

The code:

if Field is TBlobField then
  Result := TBlobField(Field).Modified

allows you to detect if the field was changed, but still does not allow you to obtain the oldValue, if you need to detect WHAT was changed and not IF something was changed.

Upvotes: 0

Tiago Moraes
Tiago Moraes

Reputation: 328

I solved the problem with

if Field is TBlobField then
  Result := TBlobField(Field).Modified

Upvotes: 3

Related Questions