rc002017 Posted June 28, 2011 Posted June 28, 2011 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 Quote
Administrators Farshad Mohajeri Posted June 28, 2011 Administrators Posted June 28, 2011 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? Quote
rc002017 Posted June 29, 2011 Author Posted June 29, 2011 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 ? Quote
Administrators Farshad Mohajeri Posted June 29, 2011 Administrators Posted June 29, 2011 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. Quote
rc002017 Posted June 29, 2011 Author Posted June 29, 2011 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 ? Quote
rc002017 Posted June 29, 2011 Author Posted June 29, 2011 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." Quote
Administrators Farshad Mohajeri Posted June 29, 2011 Administrators Posted June 29, 2011 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. Quote
rc002017 Posted June 30, 2011 Author Posted June 30, 2011 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 ! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.