Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Discussions (General)
 FYI - Members Timing Out
 New Topic  Topic Locked
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 4

GauravBhabu
Advanced Member

4288 Posts

Posted - 30 December 2002 :  09:13:36  Show Profile
quote:
Originally posted by HuwR

it is cachesize which governs how many records are fetched, not the pagesize, if you set cachesize to 15 and pagesize, it will only fetch 15 records, not the whole 25.




Not so with GetRows
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20600 Posts

Posted - 30 December 2002 :  14:02:34  Show Profile  Visit HuwR's Homepage
perhaps we should not do this GetRows(adGetRowsRest)

adGetRowsRest is what makes it fetch the entire recordset
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 30 December 2002 :  15:38:34  Show Profile
Exactly, HUWR. It should be GetRows(strPageSize) for most situations in snitz code.

Edited by - GauravBhabu on 30 December 2002 15:42:18
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20600 Posts

Posted - 31 December 2002 :  06:04:44  Show Profile  Visit HuwR's Homepage
I think this would require a rethink of the paging code though. I know you can also pass a start value, but this requires that the db driver supports bookmarking, which may not be the case for mysql, but I do not know for sure.
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 31 December 2002 :  07:27:49  Show Profile
I think it does support bookmarks.
quote:

MyODBC 3.51 supports three types of scrollable cursors, using this, an application can move backward and forward in the result set based on the requirement:

Forward-only
Static and
Dynamic (only from MyODBC 3.51.01)
Note, driver doesn't yet support Key set-Driven Cursor type, and to have dynamic support, one must check the option "Enable Dynamic Cursor Type" from DSN settings or by passing OPTION=32 as the connection string.


Application can set the cursor type through SQLSetStmtAttr (or SQLSetStmtOption in MyODBC 2.50 driver) with option as SQL_ATTR_CURSOR_TYPE. By default, driver implicitly uses forwards-only cursor.


Using the forwards-only cursor, an application can only forward in the result set, and it can not go backward, where as in the other case, Static cursor type, an application can move forward or backward or to any desired location in the result set.



http://www.mysql.com/products/myodbc/manual.html#Cursor_Types
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20600 Posts

Posted - 31 December 2002 :  10:53:29  Show Profile  Visit HuwR's Homepage
cursors are not the same as bookmarks, it needs to support bookmarks in order to all

getrows(start,pagesize)
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 31 December 2002 :  13:01:50  Show Profile
...Using the forwards-only cursor, an application can only forward in the result set, and it can not go backward, where as in the other case, Static cursor type, an application can move forward or backward or to any desired location in the result set.

I forgot to highlight this part. However, it is GetRows(numRows, start). We can also specify the fields to get

getRows(numRows[,start][,Fields])
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20600 Posts

Posted - 31 December 2002 :  13:19:49  Show Profile  Visit HuwR's Homepage
Ok, sounds like it would work then, maybe I'll have aplay later
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 31 December 2002 :  14:13:21  Show Profile
I did some tests. One thing which is, as far as i undestoood, is that start is the bookmark value as returned by using bookmark property. So it can not be used if the page is loaded again because the recordset is created a new. Can it be?

<edited to add>
Note: When used on a client-side Recordset object, the Bookmark property is always available.



So using the AbsolutePage property seems to be the choice


Recordset.PageSize = varNumberOfRecords
varPageCount = Recordset.PageCount
if varPageNumber > varPageCount then varPageNumber = varPageCount
Recordset.AbsolutePage = varPageNumber
varRowsArray = Recordset.GetRows(varNumberOfRecords, adBookmarkCurrent)

'adBookmarkCurrent = 0 
'This is also default setting for GetRows 
'the following statement will behave same as above
 
varRowsArray = Recordset.GetRows(varNumberOfRecords)




We can also use the Recordset.Move method to get specific records (First n Records, last n records, n records starting from nth record) from the recordset, though that will require additional coding to set the value for AbsolutePage property, checking the .EOF and/or .BOF property etc.

Edited by - GauravBhabu on 31 December 2002 14:47:14
Go to Top of Page

bjlt
Senior Member

1144 Posts

Posted - 20 March 2003 :  01:34:10  Show Profile
What's the solution for this finally?
Thanks.
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 20 March 2003 :  01:40:24  Show Profile
this is what we are using here:

http://forum.snitz.com/forum/topic.asp?whichpage=2&TOPIC_ID=39901#206369
Go to Top of Page
Page: of 4 Previous Topic Topic Next Topic  
Previous Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.17 seconds. Powered By: Snitz Forums 2000 Version 3.4.07