I am trying connect from Lazarus 0.9.20 application to MySQL 5.0 Database using follow visual components
DBGrid1: TDBGrid;
Debug: TMemo;
QBaseNavigator: TDBNavigator;
QBaseDatasource: TDatasource;
QBaseConnection: TMySQL50Connection;
QBaseTransaction: TSQLTransaction;
QBaseSelectQuery: TSQLQuery;
QBaseUpdateQuery: TSQLQuery;
When I execute next code
QBaseConnection.Open;
finally
if QBaseConnection.Connected
then Debug.Lines.Append('Sucessfully connected')
else Debug.Lines.Append('Connection fault');
end;
try
Debug.Lines.Append('Begin sql statement execution');
QBaseSelectQuery.SQL.Text:=('SELECT * FROM Quest_main');
QBaseSelectQuery.Active:=true;
QBaseSelectQuery.Open;
Debug.Lines.Append('end of sql statement exection');
finally
Debug.Lines.Append('sql statement executed');
Debug.Lines.Append('fields number'+intToStr(QBaseSelectQuery.FieldCount));
end;
I successfully connected to database, but after executing SQL statement I received answer with 0 fields and 0 rows.
After executing mentioned SQL statement in Query Browser i receive answer with 4 rows.
What I doing wrong?