Bug in locate method (tquery, ttable) using integers!

I'm using d5 ond ib6

A locate on an integer field that is not indexed beforehand will crash
the locate function with an ' Invalid variant type conversion' .
Presumably the vcl is trying to use the field values directly in an
ad-hoc filter which expects strings only!

The behaviour is not consistent though:
 - a TQuery component will always return this error, even with an empty
locate options set
 - a TTable component gives you a way out of it, because there you can
use an empty options set. However, it then returns the NEXT record in
the dataset!

This I simply fixed by putting in some extra code like:

    record_found:=false;
    try

Destination.Locate(KeyFields,vararrayof(KeyValues),[loCaseInsensitive]);

      record_found:=true;
    except
      on e:evarianterror do begin
//  key is numeric and no index found: FILTER screwS UP!!!!
        try
          record_found:=false;
          Destination.Locate(KeyFields,vararrayof(KeyValues),[]);
          if not Destination.eof then Destination.Prior;
          for k:=0 to KeyFieldsList.count-1 do begin
            if
Destination.fieldbyname(TField(KeyFieldsList[k]).Fieldname).asVariant=
              TField(KeyFieldsList[k]).AsVariant then
                record_found:=true;
            if record_found and (k<KeyFieldsList.count-1) then
              record_found:=false;
          end;
        except
          record_found:=false;
        end;
      end;
    end;

So, is this a real bug? Have I the wrong impression on how to use the
locate function? Why is there a different implementation for the
different datasets? I thought of this and created a separate function
with the ttable or tquery opassed as a TDataset parameter, but the
results are the same.

If this is not a bug, nut 'normal' behaviour, will it always position
the cursor on the next record in a ttable? I tested it against several
cases and it always seemed to do that, but one never knows......

If it IS a bug, anybody know of a fix?

Lewie