From: MM on
I've upgraded MDAC to 2.8. I've also looked at Q224332 ("ADO Recordset
Open Method May Behave Synchronously Even if adAsyncFetch is
Specified")

But whatever I do, the FetchProgress event will not fire
asynchronously. It fires once only at the end of a query.

Code (just the salient part):

Private WithEvents rs as ADODB.Recordset

Sub Search()

Dim conn as ADODB.Connection
Dim DatabaseName As String
Dim SQL As String

DatabaseName = "whatever.mdb"
SQL = "SELECT * FROM MyTable"

Set Conn = New ADODB.Connection
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
DatabaseName, "", ""

Set rs = New ADODB.Recordset
With rs
.CursorLocation = adUseClient
.Properties("Initial Fetch Size") = 1
' .Properties("Background Fetch Size") = 15
.CacheSize = 8
.CursorType = adOpenForwardOnly
.LockType = adLockReadOnly
.Open SQL, Conn, , , adAsyncFetch
End With
..
..
..
End Sub

I have a Debug.Print in the rs_FetchProgress event, but this ONLY
fires at the end of the query. I've tried various combinations of
values for Initial Fetch Size and Background Fetch Size (latter
commented out in the above example), but I cannot get FetchProgress to
fire during the query's execution.

Any ideas anyone?

MM
From: ralph on
On Thu, 24 Jun 2010 18:21:21 +0100, MM <kylix_is(a)yahoo.co.uk> wrote:


>
>But whatever I do, the FetchProgress event will not fire
>asynchronously. It fires once only at the end of a query.
>

>
>I have a Debug.Print in the rs_FetchProgress event, but this ONLY
>fires at the end of the query. I've tried various combinations of
>values for Initial Fetch Size and Background Fetch Size (latter
>commented out in the above example), but I cannot get FetchProgress to
>fire during the query's execution.
>
>Any ideas anyone?
>

Try setting the adAsyncConnect option in the Conn.Open statement, and
set adAsyncFetchNonBlocking (replacing the adAsyncFetch option) in the
Recordset.

-ralph
From: ralph on
On Thu, 24 Jun 2010 23:29:04 -0500, ralph <nt_consulting64(a)yahoo.net>
wrote:


>
>Try setting the adAsyncConnect option in the Conn.Open statement, and
>set adAsyncFetchNonBlocking (replacing the adAsyncFetch option) in the
>Recordset.
>

Oops!
adAsyncFetchNonBlocking is not supported with 2.6, so skip the latter
for right now.
You might try the Execute method

-ralph

From: Paul Clement on
On Thu, 24 Jun 2010 18:21:21 +0100, MM <kylix_is(a)yahoo.co.uk> wrote:


� I have a Debug.Print in the rs_FetchProgress event, but this ONLY
� fires at the end of the query. I've tried various combinations of
� values for Initial Fetch Size and Background Fetch Size (latter
� commented out in the above example), but I cannot get FetchProgress to
� fire during the query's execution.

� Any ideas anyone?

� MM

Unfortunately, from my experience this is an essentially useless and unreliable
feature in ADO.

Paul
~~~~
Microsoft MVP (Visual Basic)
From: David Kerber on
In article <lvb9269at2kn6e0q49qjad4bhhjhc9gc5s(a)4ax.com>,
UseAdddressAtEndofMessage(a)swspectrum.com says...
>
> On Thu, 24 Jun 2010 18:21:21 +0100, MM <kylix_is(a)yahoo.co.uk> wrote:
>
>
> ? I have a Debug.Print in the rs_FetchProgress event, but this ONLY
> ? fires at the end of the query. I've tried various combinations of
> ? values for Initial Fetch Size and Background Fetch Size (latter
> ? commented out in the above example), but I cannot get FetchProgress to
> ? fire during the query's execution.
> ?
> ? Any ideas anyone?
> ?
> ? MM
>
> Unfortunately, from my experience this is an essentially useless and unreliable
> feature in ADO.

I think it depends on support from the back-end server, and not many
have it.

D
 |  Next  |  Last
Pages: 1 2
Prev: VB 2008 Compile for x86
Next: Compart two times