For Fuzzy queries in databases, use * or? Replace the corresponding characters in the word to perform fuzzy search. * matching characters can be replaced by % in the database ;? The critical character can be replaced by _ In the database. instance code: CStringstrFind; m_Rich.GetWindowText (strFind); strFind. Replace (*, %); strF
For Fuzzy queries in databases, use * or? Replace the corresponding characters in the word to fuzzy query. "*" matching characters can be replaced by "%" in the database ;"? "The critical character can be replaced by" _ "in the database. instance code: CString strFind = ""; m_Rich.GetWindowText (strFind); strFind. replace ("*", "%"); strF
Fuzzy search
Fuzzy query in the database, using "*" or "?" Replace the corresponding characters in the word to fuzzy query. "*" matching characters can be replaced by "%" in the database ;"? "The critical character can be replaced by" _ "in the database.
Instance code:
CString strFind = "";
M_Rich.GetWindowText (strFind );
StrFind. Replace ("*", "% ");
StrFind. Replace ("? ","_");
CString strSQL = "";
StrSQL. format ("select. keycode as keycode,. codeno as keycodeno, B. codevalue as codevalue, B. codeno as codeno from keycount as a, codevalue as B where. keycode like '% s' and. relaxno = B. ID order by. keycode,. id ", strFind );
BOOL bExcute = ExcuteDBSQL (strSQL );