Board index » delphi » Partial List from a Long list

Partial List from a Long list

Hi, I am using Delphi 5E with ADO component and SQL Server. I have a very
long table which I have to somehow list on the screen. I can not and don't
want to use TADOQuery to retrive all the row to the screen at one, If I did
this way, somehow Delphi will not responding anymore.

These is couple way I can think of.
1) I write a stored procedure in SQL Server, which will return a CURSOR as
OUTPUT. But I don't know in DELPHI can take the return CURSOR or not. I know
there is a DataType called 'ftCursor', but is it only for Oracle?

2)I also write a store procedure in SQL Server, it will use temporary table
like #CLS1. After I fetch all the row I need to the temp table. At last line
of this procedure. I put 'SELECT * FROM #CLS1'. It work fine in SQL Server
Query Analyzer.
But when I try to use this procedure in DELPHI, when I try to active it. it
will complain 'ADOStoredProc1: CommandText does not return return a result
set'

I think my question will be
1) Does DELPHI ADO component can get a CURSOR from SQL Sever? if it can, how
to do it?
2) Does DELPHI ADO can get a temp table from SQL Server.

Any suggestion will be appreciated.

TIA

Max

 

Re:Partial List from a Long list


Quote
> Hi, I am using Delphi 5E with ADO component and SQL Server. I have a very
> long table which I have to somehow list on the screen. I can not and
don't
> want to use TADOQuery to retrive all the row to the screen at one, If I
did
> this way, somehow Delphi will not responding anymore.

1) MyADOQuery.MaxRecords := 500
2) if your server - MS SQL 7: use TOP clause in SELECT statement

Other Threads