We have a small program which runs a stored proc on the server. The result set is then processed to deliver a CSV file. We are getting an error now which seems to have come up simply because the number of rows returned is too large for a TADOQuery to handle properly. I am told that the error message is "Dataset was open." Very nice.

We have a small program which runs a stored proc on the server. The result set is then processed to deliver a CSV file. We are getting an error now which seems to have come up simply because the number of rows returned is too large for a TADOQuery to handle properly. I am told that the error message is "Dataset was open." Very nice.

If anyone has had this experience, or can suggest a better way to deal with the issue in the context of about a million rows of 60 columns returned, please shout. This is a small app which was written by someone no longer on the project, and has worked properly for 2-3 years.

Comments

  1. Bill Meyer You will find that DevArt components frequently turn out to be the magic wand necessary to fix broken DB apps and turn them into high performance ones.  I use DevArt MyDAC components in all my apps - good stuff.

    ReplyDelete
  2. As some have said, pull the results into a temp table with an identity field. Pull in chunks. Select top 1000 * from #table where ID>@LastIdInLastChunk

    ReplyDelete
  3. Try setting TADOQuery CursorLocation to clUseServer and CursorType to ctOpenForwardOnly.

    ReplyDelete

Post a Comment