MySQL Forums
Forum List  »  Delphi

What am I doing wrong?
Posted by: Henry Martin
Date: May 13, 2006 12:04PM

I have a MySQL Database called contacts and a Table called contact.

On a form I have a dbGrid, an TSQLDatabase component a TDataSource component and a TMySQLQuery. To troubleshoot, I added a button and below is the OnClick

DBGrid1.DataSource := DataSource1;
mySQLQuery1.Active := FALSE;
mySQLQuery1.Prepare;
mySQLQuery1.SQL.Clear;
mySQLQuery1.Active;
mySQLQuery1.SQL.Add('SELECT * from Contact where LastName LIKE "S%"');
mySQLQuery1.ExecSQL;

If I type the select statement into the Object Inspector SQL it works fine.

What am I doing wrong?

Options: ReplyQuote


Subject
Written By
Posted
What am I doing wrong?
May 13, 2006 12:04PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.