I would like to know how would I write a piece of code to search a database based on a keyword entered? I haven't started yet but I don't even know the syntax for writing such a program/subprogram plz help

First of all you need to use Delphi build in Database components and choose which database you will use... after that you use Query and DataSource component...
Once you set up these you're ready to go...

you need a button and edit or (text box)

Query1.Close;{close the query}
Query1.SQL.Add ('Select * from TABLE');
Query1.SQL.Add ('WHERE NAME = ''' + Edit1.Text + '''');

you also need to use the DBGrid where you will show the results.

Hope this is what you are asking.


Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.