Page 1 of 1

tmyqury and a dblookuplistbox

Posted: Tue 20 Jun 2006 20:22
by alan
I have a TDBLookUpListBox on my form. I am populating it with a TMyQuery->SQL= "SELECT * FROM Site_ID" initially from the designer.

Now if a user wants to narrow the items in the TDBLookUpListBox how do you go about it?

I have been trying to change the SQL statment like this:

MyQuery_Site_ID->SQL->Text ="SELECT * FROM Site_ID WHERE Version_Inv = 1";

But this raises a exception.

Thanks.

Posted: Wed 21 Jun 2006 10:13
by Antaeus
Please specify some things:
- Exact text of error message you get
- Exact version of Delphi, C++ Builder or Kylix
- Exact version of MyDAC. You can see it in About sheet of TMyConnection Editor
- Exact version of MySQL server and MySQL client. You can see it in Info sheet of TMyConnection Editor

Posted: Wed 21 Jun 2006 17:07
by alan
I found out what was going on.
When you programatically change the SQL text it sets the MyQuery->Active = false. Also it calls the OnChange event on the TDBLookUpListBox which tried to update a bunch of data-aware components which all threw exceptions because MyQuery->Active was false.
I did a workaround and its running now.