Re: [fpc-pascal] SQL show tables

2009-01-14 Thread David B Copeland
On Tue, 2009-01-13 at 10:37 +, Martin Friebe wrote: > > > If you (the original poster) uses Mysql 5 or up, then "Show tables" is > not needed. Use the information-schema instead > > SELECT table_name FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = > '/|db_name|/' > Yes, I tried t

Re: [fpc-pascal] SQL show tables

2009-01-13 Thread David B Copeland
On Tue, 2009-01-13 at 10:37 +, Martin Friebe wrote: > Joost van der Sluis wrote: > > Op maandag 12-01-2009 om 13:30 uur [tijdzone -0500], schreef David B > > Copeland: > > > > > >> "Query: Cannot open a non-select statement" > >> > > > > 'show tables' is not a valid sql-statement. It

Re: [fpc-pascal] SQL show tables

2009-01-13 Thread Martin Friebe
Joost van der Sluis wrote: Op maandag 12-01-2009 om 13:30 uur [tijdzone -0500], schreef David B Copeland: "Query: Cannot open a non-select statement" 'show tables' is not a valid sql-statement. It is a MySQL-hack. The TODBCConnection can not see that it is connected to a MySQL server

Re: [fpc-pascal] SQL show tables

2009-01-13 Thread Joost van der Sluis
Op maandag 12-01-2009 om 13:30 uur [tijdzone -0500], schreef David B Copeland: > "Query: Cannot open a non-select statement" 'show tables' is not a valid sql-statement. It is a MySQL-hack. The TODBCConnection can not see that it is connected to a MySQL server and thus doesn't recognise this state

Re: [fpc-pascal] SQL show tables

2009-01-12 Thread David B Copeland
Ah yes, you are correct. However the the Open returns the following error: "Query: Cannot open a non-select statement" I also have found some more help in the Lazarus wiki which just happens to have an example of how to do a "show tables". So then, I tried the following: FormMyDB.Query.SQL.Cle

Re: [fpc-pascal] SQL show tables

2009-01-12 Thread ABorka
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: Hi, 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

[fpc-pascal] SQL show tables

2009-01-12 Thread David B Copeland
Hi, 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.Clear; Fo