Problems with MyQuery

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
EdderU2RSE
Posts: 10
Joined: Tue 17 Apr 2007 19:47

Problems with MyQuery

Post by EdderU2RSE » Wed 18 Apr 2007 15:58

I'm finding a field in my table using MyQuery.
I Have a Database called Cars, with the next fields: Marca, Modelo, Color
My components are:
1 edit called txtmarca
1 Myquery
1 button
2 DBedit, to show modelo and color

My code in MyQuery is:
SELECT *FROM cars
WHERE marca=marca

My button:
MyQuery.close;
MyQuery.SQL.clear;
MyQuery.SQL.Text:='SELECT *FROM cars WHERE marca="'+txtmarca.text+'"';
MyQuery.Open;

I think that everything is ok, but I cant see the results in my DBedit.

Example:
When I write in marca='Ford'
I need to show Modelo=Lobo and color=Rojo
etc.......

P.S thanks :shock:

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

Post by Antaeus » Thu 19 Apr 2007 11:00

Please check that your DBEdit controls are set up properly (they are attached to MyQuery via TDataSource, and the DataField properties are set). Also check that your query returns not empty result set (MyQuery.RecordCount more than zero).

Post Reply