tmyqury and a dblookuplistbox

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
alan

tmyqury and a dblookuplistbox

Post by alan » Tue 20 Jun 2006 20:22

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.

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Wed 21 Jun 2006 10:13

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

alan

Post by alan » Wed 21 Jun 2006 17:07

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.

Post Reply