Delphi Event generation and handling , using TclientDataSet with pagination --> urgent

How to go about Delphi Event generation and handling and using TclientDataSet.

1) input to the TclientDataSet will be an XML with the database values

the problem is ,

1) i am new to delphi

2) from the database the no of records retreived will be around 30000 , but in need to show only first 1000 records at the start, after the user scrolls up to the last record , i need to generate an event which will hit the database to get the next set of 1000 records and so on.(pagination should occur).

How to tackle this situation. i am using an EJb application deployed as an web service, which will retreive the values from the database.

I need a suitable design and a solution in terms of idea and little bit of code snippets will be nice of you.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Check the stateless fetching example from this site:

It shows how the pass a key value from the client to the server and fetch the next set of records (using PacketRecord property).

For your case, you may need to modify the BeforeGetRecords of DataSetProvider to return a resultset of a query something like this:

Select Top 1000 * From TableName
Where ID > SomeValue

This will work only if the ID s are incremental.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.