[python-win32] FetchProgress event problem
Tim Roberts
timr at probo.com
Fri Dec 23 19:38:02 CET 2005
On Thu, 22 Dec 2005 10:15:29 -0500, Dawid Zamirski <dzrudy at gmail.com> wrote:
>I'm trying to track recordset loading progress (it is loaded
>asynchronously), but neither FetchProgresss or FetchComplete event is
>launched. I played with WillMove events in sychronous mode and they work
>just fine. Can someone guide me how to get those events fired? I'm using
>pywin32 build 205. Here's my test code:
>
>import win32com.client
>
>class RSEvents:
> def OnWillMove(*args):
> print "will move"
>
> def OnFetchProgress(*args):
> print "fetch progress"
>
> def OnFetchComplete(*args):
> print "fetch complete"
>
>def Test():
> conn = win32com.client.Dispatch(r"ADODB.Connection")
> connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=test.mdb"
> conn.Open( connstr )
> rs = win32com.client.DispatchWithEvents(r"ADODB.Recordset", RSEvents)
> rs.CursorLocation = 3
> rs.Open("SELECT * FROM test", 3, 1, 49)
>
>if __name__ == "__main__":
> Test()
>
>
Besides Roger's comments, in this PARTICULAR example, you have not
connected the Recordset with the Connection. Don't you want this:
rs.Open( "SELECT * FROM test", conn, 3, 1, 49 )
or:
rs.Open( "test", conn, 3, 2, 49 )
--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.
More information about the Python-win32
mailing list