Jump to content

ADO Query rows returned


rc002017

Recommended Posts

I am writing a simple VCL/Standalone/Isapi app that retrieves rows from a SQL Server database as a test. The rows are displayed in a UniDBGrid. When I run it in as a normal Windows app, the grid is populated with say 200 records, and the ADO Query RecordCount is 200.

 

If I now run it as an ISapi DLL and connect using Firefox or IE, the same ADO Query only returns approx 30-40 records to the UniDBGrid. However the ADO Query RecordCount is still 200.

 

Any suggestions on where I am going wrong ?

 

Thanks

Link to comment
Share on other sites

  • Administrators

I am writing a simple VCL/Standalone/Isapi app that retrieves rows from a SQL Server database as a test. The rows are displayed in a UniDBGrid. When I run it in as a normal Windows app, the grid is populated with say 200 records, and the ADO Query RecordCount is 200.

 

If I now run it as an ISapi DLL and connect using Firefox or IE, the same ADO Query only returns approx 30-40 records to the UniDBGrid. However the ADO Query RecordCount is still 200.

 

Any suggestions on where I am going wrong ?

 

Is your Grid in paged mode? If yes how many pages are there?

Link to comment
Share on other sites

Is your Grid in paged mode? If yes how many pages are there?

 

 

The grid is paged, I set it to 100 pages and now more rows are displayed. Seems to solve the problem, thanks.

 

Is there a guideline for estimating the number of pages needed, especially at run time, based on the number of rows retrieved ?

Link to comment
Share on other sites

  • Administrators

The grid is paged, I set it to 100 pages and now more rows are displayed. Seems to solve the problem, thanks.

 

Is there a guideline for estimating the number of pages needed, especially at run time, based on the number of rows retrieved ?

 

Normally you can't adjust number of pages.

 

You only set the PageSize from WebOptions and number of pages are calculated automatically.

 

Number of pages = RecordCount div PageSize.

Link to comment
Share on other sites

Normally you can't adjust number of pages.

 

You only set the PageSize from WebOptions and number of pages are calculated automatically.

 

Number of pages = RecordCount div PageSize.

 

Thanks Farshad.

 

I have run a test with the PageSize set (at design time) to just above the expected number of rows to be retrieved by the ADO query, and all rows are now displayed in UniDBGrid i.e. set PageSize to 250, ado query retrieves 200 rows, all rows displayed. ADO query cache set to 100.

 

If I try to set the PageSize at run time based on record count, and then hook up the datasource to the query, it does not display all rows retrieved, only the same number of rows as the PageSize. I also set the ado query cache to 250, but only the amount of rows as per PageSize are displayed in the grid. In both instances the PageSize was set to 50, Paged=true.

 

Perhaps this is something to do with the ADO component(s) ? Is this problem evident with other database access components ?

Link to comment
Share on other sites

Thanks Farshad.

 

I have run a test with the PageSize set (at design time) to just above the expected number of rows to be retrieved by the ADO query, and all rows are now displayed in UniDBGrid i.e. set PageSize to 250, ado query retrieves 200 rows, all rows displayed. ADO query cache set to 100.

 

If I try to set the PageSize at run time based on record count, and then hook up the datasource to the query, it does not display all rows retrieved, only the same number of rows as the PageSize. I also set the ado query cache to 250, but only the amount of rows as per PageSize are displayed in the grid. In both instances the PageSize was set to 50, Paged=true.

 

Perhaps this is something to do with the ADO component(s) ? Is this problem evident with other database access components ?

 

 

Sorry, not entirely clear, should read "If I try to set the PageSize at run time based on record count, and then hook up the datasource to the query, it does not display all rows retrieved, only the same number of rows as the PageSize setting prior to changing at run time i.e. used design time setting."

Link to comment
Share on other sites

  • Administrators

In Paged mode there is a paging navigator under Grid which allows you to navigate across pages. Page size should be around 25-40 rows and you will navigate using paging toolbar located on bottom of UniDBGrid.

 

If you disable paged mode then all records are displayed but this is not recommended if your dataset contains hunderds of records, as lots of rows will take a long time to load and very slow to browse.

Link to comment
Share on other sites

In Paged mode there is a paging navigator under Grid which allows you to navigate across pages. Page size should be around 25-40 rows and you will navigate using paging toolbar located on bottom of UniDBGrid.

 

If you disable paged mode then all records are displayed but this is not recommended if your dataset contains hunderds of records, as lots of rows will take a long time to load and very slow to browse.

 

Thanks Farshad, understood. Using the navigator solved the problem !

 

PS Good work on the component set, really excellent !

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...