Invalid Variant Type Conversion Error - This is where it stops

I have just recently started getting this error when I apply cached
updates to a detail table.  As far as I know I haven't changed any code
to cause this error, it just started happening.  This is where the code
stops, at the line with ** at the beginning.  The path to this code is
Delphi5\Source\rtl\Sys\system.pas Can anyone shed any light on what is
causing this, please!  Thanks.

procedure VarChangeType(var Dest: Variant; const Source: Variant;
  DestType: Word);
type
  TVarMem = array[0..3] of Integer;

  function ChangeSourceAny(var Dest: Variant; const Source: Variant;
    DestType: Word): Boolean;
  begin
    Result := False;
    if TVarData(Source).VType = varAny then
    begin
      AnyChangeType(Dest, Source, DestType);
      Result := True;
    end;
  end;

var
  Temp: TVarData;
begin
  case TVarData(Dest).VType of
    varString:
      begin
        if not ChangeSourceAny(Dest, Source, DestType) then
        begin
          Temp.VType := varEmpty;
          if VariantChangeTypeEx(Variant(Temp), Source, $400, 0,
DestType) <> 0 then
          VarCastError;
          _VarClear(Dest);
          TVarMem(Dest)[0] := TVarMem(Temp)[0];
          TVarMem(Dest)[2] := TVarMem(Temp)[2];
          TVarMem(Dest)[3] := TVarMem(Temp)[3];
        end;
      end;
    varAny: AnyChangeType(Dest, Source, DestType);
  else if not ChangeSourceAny(Dest, Source, DestType) then
    if VariantChangeTypeEx(Dest, Source, $400, 0, DestType) <> 0 then
**      VarCastError;
  end;
end;