Letraindusoir Posted November 19, 2019 Share Posted November 19, 2019 In VB or other programming languages, fuzzy query displays database retrieval results in real time, which is easy to implement. Taking vb as an example, the database query code is written in the Text_change event of the text box, and the retrieval results can be displayed in real time in the Datagrid control while inputting the retrieval words. In Au3, I don't know how to implement it. I just know that can replace Text_change with $EN_change(As shown below), but how to make the results of fuzzy queries display in Listview without any delay, I Has no idea. Which friend knows a similar example, or if there are any related custom functions, please give me a link? $Form1 = GUICreate("", 533, 464) $Input_1 = GUICtrlCreateInput("", 10, 20, 190, 20) $Label_2 = GUICtrlCreateLabel("", 220, 30, 130, 20) local $idlistview=GUICtrlCreateListView("aa |bb",10,50,513,400) Global Const $WM_COMMAND = 0x0111 GUIRegisterMsg($WM_COMMAND, "MY_WM_COMMAND") GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = -3 ExitLoop Case Else ;;; EndSelect WEnd Func MY_WM_COMMAND($hWnd, $msg, $wParam, $lParam) Local Const $EN_CHANGE = 0x300 Local $nNotifyCode = BitShift($wParam, 16) Local $nID = BitAND($wParam, 0xFFFF) Local $hCtrl = $lParam If $nNotifyCode = $EN_CHANGE Then GUICtrlSetData($Label_2, GUICtrlRead($Input_1)) GUICtrlCreateListViewItem(GUICtrlRead($Input_1), $idListview) EndIf EndFunc ;==>MY_WM_COMMAND Link to comment Share on other sites More sharing options...
Nine Posted November 19, 2019 Share Posted November 19, 2019 Depends on database. But the general idea would be to have some sort of callback function for each row retrieved. In SQLite for example, _SQLite_Exec is doing exactly that. Letraindusoir 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Letraindusoir Posted November 19, 2019 Author Share Posted November 19, 2019 (edited) Thank you for your advice! I just want to use editbox-listview-sqlite to implement this process. However, I am not very familiar with the operation of listview and sqlite. by general method, although the process of retrieval data from sqlite and inserting listview can be realized, there is obvious lag phenomenon, especially when the amount of data exceeds thousands, it is more obvious and even stops responding. So want to refer to similar examples to learn, if there is a packaged UDF that is the best. But my English is not good, can not search for similar appropriate examples. Edited November 19, 2019 by Letraindusoir Link to comment Share on other sites More sharing options...
LarsJ Posted November 20, 2019 Share Posted November 20, 2019 Using a virtual listview and this technique to extract data from the SQLite database will not generate any delay at all. Letraindusoir 1 Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
Letraindusoir Posted November 21, 2019 Author Share Posted November 21, 2019 19 hours ago, LarsJ said: Using a virtual listview and this technique to extract data from the SQLite database will not generate any delay at all. Thank you so much,LarsJ , it seems to be the best solution.I'll make a good study. Link to comment Share on other sites More sharing options...
Nine Posted November 21, 2019 Share Posted November 21, 2019 (edited) If the response delay of the DB is long, it is also possible that the DB is not optimized for that specific query. Using index for example could largely increase decrease (ooops) response time... Edited November 21, 2019 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
jchd Posted November 21, 2019 Share Posted November 21, 2019 Decrease perhaps? Nine 1 This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now