Board index » delphi » Novice's question: Searching a list

Novice's question: Searching a list

Hi all: I'm fairly new to programming and to Delphi, and I have a question:

I have a list of names, job titles and location.
I would like to create a small program that would enable the user to search
for names in the list.
The user would either type in the first, last or both names to find the
person.
I don't require searches by job titles or location, but I would like that
information to appear as part of the search result.

Is this something that Delphi can handle?

Like I said, I'm fairly new to Delphi, and I haven't digested all of the
ins and outs of the language just yet.

Thanks a lot.

Mike Elek

 

Re:Novice's question: Searching a list


Hi back!

Yes, Delphi can definately handle this search.  You didn't
mention if/what type of database you will be using (paradox is
probably the easiest.  Here are the steps.

1.  Database desktop.  Create a table for users - include first
name field, last name, etc.  Enter data in the table.
2.  On a Delphi form, put an edit box for each field you want
to search on.  Also put a button with a find caption.
3.  On the same delphi form put either database components
(listed in many books) or use a query.
4.  Select the find button, hit F11, select events, then double
click on the onClick event (this creates a procedure that runs
when the user clicks the button.
5.  If you decide to use the TQuery, set the .sql to
    'Select * from user where name = ' + edtUser.Text;
6.  do a .sql.open;

7.  This will give you a result set for the search.

Hope this gets you started.        

Other Threads