Board index » delphi » Cann't get results from INFORMATION_SCHEMA.COLUMNS by TQuery

Cann't get results from INFORMATION_SCHEMA.COLUMNS by TQuery

Dear all

If you execute this command in SQL2000 Enterprise Manager then you will get
a result set of all columns of 'MYTABLE'

SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE
TABLE_NAME='MYTABLE'

However if you use a Dephi5 TQuery with its SQL as above, you can 'Open' the
TQuery, but you will get no results.

Anyone can teach us why?

Thanks
John

 

Re:Cann't get results from INFORMATION_SCHEMA.COLUMNS by TQuery


Dear all

If you execute this command in SQL2000 Enterprise Manager then you will get
a result set of all columns of 'MYTABLE'

SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE
TABLE_NAME='MYTABLE'

However if you use a Dephi5 TQuery with its SQL as above, you can 'Open' the
TQuery, but you will get no results.

Anyone can teach us why?

Thanks
John

Re:Cann't get results from INFORMATION_SCHEMA.COLUMNS by TQuery


1. cast is as varchar:
SELECT CAST(COLUMN_NAME as VARCHAR(254)) FROM .....
2. switch to ADO. BDE works via DBLib, which Microsoft didn't update since
MSSQL 6.5

--
Robert

Quote
John wrote in message <3ce5a2da_1@dnews>...
>Dear all

>If you execute this command in SQL2000 Enterprise Manager then you will get
>a result set of all columns of 'MYTABLE'

>SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE
>TABLE_NAME='MYTABLE'

>However if you use a Dephi5 TQuery with its SQL as above, you can 'Open'
the
>TQuery, but you will get no results.

>Anyone can teach us why?

>Thanks
>John

Other Threads