Filter SQL data according to input from an edit box

Hey guys

Iam trying to create a database using delphi 2009, SQL with a access database. What I want is the following:
I have an edit box, a grid and button on a form.

When I type something in the edit box (doesn't matter what word), then when I click the button I search in the database and when a title with this word is found, the title is displayed in the grid.

I this code already, but get nothing ( only empty grid).
procedure TForm1.Button7Click(Sender: TObject);
with ADOQuery1 do
//assign new SQL expression
SQL.Add ('SELECT Songtitle, Genre');
SQL.Add ('FROM songs');
SQL.Add ('WHERE Songtitle = "' + SearchData.Text + '"');
SQL.Add ('ORDER BY Songtitle');
Open; {open query + display data}

Please help.


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!