Mika Koistinen

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: case insensitive Lookup field in delphi #57317
    Mika Koistinen
    Participant

    Actually solution was more simple than I tought.

    TCaseInsentiviveKbmMemtable = class (TkbmMemTable)
        function Lookup(const KeyFields: string; const KeyValues: Variant; const ResultFields: string): Variant; overload; override;
     end;
    ...
    function TCaseInsentiviveKbmMemtable.Lookup(const KeyFields: string; const KeyValues: Variant;
      const ResultFields: string): Variant;
    var
      options: TLocateOptions;
    begin
      options := [loCaseInsensitive];
      Result:=Lookup(KeyFields,KeyValues,ResultFields,options);
    end;
    in reply to: case insensitive Lookup field in delphi #57316
    Mika Koistinen
    Participant

    Thanks For this.
    Actually at that point primary customer using that updated data to match case. But now we got two more cases.
    My code is like this

     
    fProdLookup := tKbmMemTable.create(self);
    q.sql.Text := 'select number,name from products';
    q.UniDirectional := true;
    q.open;
    fProdlookup.LoadFromDataSet(q, [mtcpoStructure,mtcpoProperties]);
    fProdLookup.addIndex('iNumber','number',[ixCaseInsensitive]);
    fProdLookup.indexName := 'iNumber';
    

    But still case casesensitive lookups.

Viewing 2 posts - 1 through 2 (of 2 total)