Keyword Search

Posted on 2003-03-15
Medium Priority
Last Modified: 2010-05-01

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
Question by:JayeshC
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

robertlees earned 340 total points
ID: 8144411
Is this the sort of thing you wanted to do ?

Sub SearchArray()
   dim a as integer


   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

Author Comment

ID: 8144644
u guys are damn geniouses. thank u soo so much

Expert Comment

ID: 8145024
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

     .move next
 end if

end with

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question