Home > Back-end >  Help: on the premise of existing data sets, how can not access the database to achieve the objective
Help: on the premise of existing data sets, how can not access the database to achieve the objective

Time:09-18

There is the specific problem, I have a combo box, loading time already took the data from the database, in the data set, as follows:
 
SQLStr:=';
SQLStr: SQLStr=+ 'the select distinct name from the list'.
OraGetData (SQLStr);
RzComboBox1. Items. The Clear;
With OraQuery do
The begin
First;
While not eof do
The begin
RzComboBox1. Items. The Add (FieldByName (' name '). AsString) are identical.
Next;
end;

Now hope when use this comboBox can fuzzy query, such as input "12", the drop-down to find all of the "123" "312" and so on, but don't have to read data from the database, how to achieve this?

CodePudding user response:

This is ok, the code is more complex:


Designing idea:
1, the use of StingList, preserve the original collective reading data;
2, through the input of characters, from StingList choice, the appropriate string;
3, type the characters again, still have to return to the original string,
Above and by pinyin, search of Chinese characters, for your usage, to establish a fuzzy search function, from the original characters, the search string,
  • Related