Jump to content

Is there an example of displaying the results in real time while entering the retrieval words?

Recommended Posts

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
While 1
    $msg = GUIGetMsg()
        Case $msg = -3
        Case Else
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)
EndFunc   ;==>MY_WM_COMMAND


Share this post

Link to post
Share on other sites

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.

Share this post

Link to post
Share on other sites

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 by Letraindusoir

Share this post

Link to post
Share on other sites

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 by Nine

Share this post

Link to post
Share on other sites

Decrease perhaps? ;)

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 here
RegExp tutorial: enough to get started
PCRE 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)

Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...