[fpc-pascal] SQL show tables
fpc-devel at aborka.com
Mon Jan 12 18:41:00 CET 2009
I think "execsql" never returns any records, you supposed to use "open"
for queries returning results.
Execsql is for insert, delete, update, etc.
David B Copeland wrote:
> I am trying to pre-fill a TComboBox with the all the tables in a
> database, without sucess. I am running Suse 10.3, a recent (within a
> week) Lazarus 0.9.27 from svn, FPC 2.2.2, 64-bit. The program uses a
> ODBCConnection to a MySQL database.
> The code I tried is:
> FormMyDB.Query.SQL.Add ('show tables;');
> if FormMyDB.Datasource.DataSet.EOF then
> ShowMessage ('There are no tables!'); // This gets displayed
> while not FormMyDB.Datasource.DataSet.EOF do begin
> except on e: exception do begin
> ShowMessage ('Error load table names: ' + e.message);
> The ExecSQL appears to complete normally, but the result dataset is
> empty. What am I doing wrong? In other parts of the program I
> successfully both query and update various tables in the database. Any
> pointers in the right direction will be greatly appreciated.
> Dave Copeland.
> fpc-pascal maillist - fpc-pascal at lists.freepascal.org
More information about the fpc-pascal