Getmetarowsfound – Kofax DM API User Manual
Page 218

198 C
HAPTER
4
GetMetaRowsFound
GetMetaRowsFound
Use this method to identify the total number of rows of metadata that
are returned when your search or lookup executes.
Syntax
PCDLookup.GetMetaRowsFound()
PCDRecentDoc.GetMetaRowsFound()
PCDSearch.GetMetaRowsFound()
Returns
Returns a long integer that contains the number of rows of metadata in
the result set that your search or lookup returned.
Usage
You can use the row count value that GetMetaRowsFound returns in a
“
For 1 to TotalRows
” loop to iterate through the metadata result
set. While use of the number returned by GetMetaRowsFound is
sometimes appropriate, there are performance considerations. Calling
this method causes the server to wait until the search has completely
finished retrieving all data from the database. The server will not return
control to your application until all processing of the search or lookup
is complete.
Those performance considerations suggest that it may be preferable to
use an alternate method of iterating through the metadata result set.
For example, instead of a “
For
” loop, you can use the
method
to position the pointer to row zero, and then use a “
While
YourObj.
” loop to iterate through the metadata result set.
Using this procedure, the server retrieves large metadata result sets in
smaller “chunks” according to parameters set by the
method.
Example
The GetMetaRowsFound method is used in the
discussion in Chapter 3.