I have a large local database (about 65,000 records) and need to be
able to populate a grid with continually updated information. The
search is performed so that partial names, and other info can be
entered in any order. As soon as the record appears enter will end
the interactivesearch. So in the interactivechange event of a text
field on the form I have placed the following code. In the setup form
I give the the user the option of turning off the incremental search
(interactivechange event).
"
IF butintch=.t.
loopvar=getwordcount(this.value)
filtervalue=''
FOR counter = 1 TO loopvar
filtervalue=filtervalue+'"'+ GETWORDNUM(this.Value,counter)+ '"'+" $
namepath and "
ENDFOR
filtervalue=UPPER(LEFT(filtervalue,LEN(ALLTRIM(filtervalue))-4))
SELECT karaoke
SET FILTER TO &filtervalue
GO top
thisform.grid1.refresh
endif
"
On a small database this works great but when used with a 65,000
record table the filter slows the program considerably. Is there any
way to perform a search such as this without using a filter to narrow
the results down. I realize that the continual calling of the set
filter to is causing the bottleneck but cannot see anyother way to
perform this kind of search. The field it is searching on is 150
characters. and includes the filename and path.
It is for a karaoke song look up. The file structure is such that
directories could appear as below.
c:\karaoke\full discs\ah8001
and an example filename would be
ah8001-01 - Healey, Jeff - Angel Eyes.zip
The use might only remember that some guy named Jeff sung a song about
eyes and the disc number was 8001
So with the above search box I could type in
"
jef eye 8001
"
and the program would narrow it down to this file.
Any help would be appreciated. Thank you in advance.