Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 244
  • Last Modified:

Keyword Search

Hi.

I am working on a database program right now and i was wondering if anyone knew how to do a keyword search of an array.


so basically i load a data file, and then i wanna search the array for anything close to it. and then output the result. does anyone know of any tutorial programs that teach this or do you know how to do this. Visual Basic 6.0 code only. Thanks alot.

and the search will be from a textbox
0
JayeshC
Asked:
JayeshC
1 Solution
 
robertleesCommented:
Is this the sort of thing you wanted to do ?

Sub SearchArray()
   dim a as integer

   lbxResults.Clear

   for a = lbound(ary) to ubound(ary)
      if instr(ary(a),txtSearch.txt) > 0 then
         lbxResults.additem ary(a)
      end if
   next a
end sub
0
 
JayeshCAuthor Commented:
u guys are damn geniouses. thank u soo so much
0
 
PhiliPCommented:
database? ah, recordset!


dim rsSearch as adodb.recordset
dim fldSearch as adodb.field
dim strSearch as string

'populate recordset you fill in
set rsSearch = objSomething.getSomeRs


with rsSearch
 if .Recordcount then
   do while not .eof
     for each fldSearch in .fields

        if strSearch = fldsearch.value then
           'do something
        end if

     next
     .move next
   loop
 end if

end with
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now