(Mike Mitchell)
5/21/2012 2:36:00 PM
On Mon, 21 May 2012 10:33:34 +0100, MM <kylix_is@yahoo.co.uk> wrote:
>On Sun, 20 May 2012 13:44:22 -0500, ralph <nt_consulting64@yahoo.com>
>wrote:
>
>>On Sun, 20 May 2012 11:32:47 +0100, MM <kylix_is@yahoo.co.uk> wrote:
>>
>><snipped>
>>>>
>>>>
>>>>Your suspicions are correct. The VirtualData Property is ignored if
>>>>the DataMode property is flexDMFree. (The DataMode property also
>>>>disables or modifies the effects of other methods as well.) If you
>>>>examine the two DataMode properties you'll see why that is true.
>>>
>>>I believe you. But as a matter of interest, where/how did you find
>>>this out? I did some Googling and didn't find it mentioned anywhere.
>>>It doesn't say so explicitly in the VideoSoft manual. Sure, it
>>>explains the various side effects of flexDMFree, flexDMBound and
>>>flexDMBoundImmediate, but under VirtualData it just says: "The
>>>VirtualData property is relevant only when the grid is bound to a
>>>recordset." Well, it's still being bound, isn't it, even if I select
>>>flexDMFree?
>>
>>
>>In general control terms the expressions "bound" or "unbound" refers
>>to the location of the control's current store. Whether or not a
>>control maintains a "synchronous" relationship with the database is an
>>attribute of a "data-bounded" control.
>>
>>With VSFlexGrid the traditional form of 'data binding', where the data
>>is stored, is actually selected by the developer upon his choice of
>>the initial component to use. Once that is done, as far as VSFlexGrid
>>is concerned, "bounded" takes on a more specific meaning - what
>>DataMode is selected - synchronous or non-synchronous.
>>
>>ie, there is "bound", and then there is "Flex bound". <g>
>>
>>> <snipped>
>>>Yes, but SOMEtimes I just want an overview of the whole lot. The
>>>VirtualData property (that e.g. MSFlexGrid doesn't have) is great for
>>>that.
>>>
>>
>>Not sure what you mean by that. That is, I can't quite equate "loading
>>smaller chunks of data on an as needed basis" with "providing an
>>overview of the whole lot", unless you mean the ability to just view
>>the first few records is providing an "overview".
>>
>>If better performance and more flexibilty is of interest, you might
>>consider writing your own data aware classes (storage) and use the
>>FlexDataSource Property.
>>
>>-ralph
>
>Since my last post I have discovered a few things:
>
>1. The 15 seconds it's taking to show the 1.5 million recordset is
>actually made up of 13 secs to Open, i.e. generate, the recordset
>(using a simple SQL query, i.e. no sorting, no WHERE clause), plus
>only 2 secs for VsFlexGrid to load it! This 2 secs is irrespective of
>whether DataMode is set to flexDMBound or flexDMFree.
>
>2. I've tried reducing the time taken to generate the recordset, using
>various settings for CursorLocation, CursorType, LockType etc, but it
>doggedly remains at +/- 15 secs.
>
>3. When I say I'd like a complete overview sometimes and I see the
>VirtualData property as a way to get that, I don't mind if it takes
>VsFlexGrid a few 10ths of a sec to move in another bunch of records as
>I scroll up or down. But at least it's possible with VsFlexGrid (as
>opposed to e.g. MsFlexGrid).
>
>4. Since the time taken by VsFlexGrid to show the initial records is
>minimal, even with 1.5 million records in the recordset, what I need
>is a way to generate a recordset in stages! That is, Open the
>recordset (rs.Open etc etc), but tell ADO to only fetch, say, a 1/4 of
>the records. Then at some point the grid or ADO realises I've run out
>of road, so the next 1/4 is taken, and so on. This is what I'm now
>looking at whether possible and how to do it.
>
>I believe this may be possible using adAsyncFetch, although I do
>recall trying using it some years ago and that it didn't work with an
>Access mdb.
>
>MM
Further to the above, the following statement reduces the delay down
to 4 secs (from about 15 secs):
rs.Open SQL, Conn, adOpenStatic, adLockOptimistic, adAsyncFetch
It's like magic!
MM