COM callbacks in Python

Dan danbrwn at
Thu Mar 23 22:13:47 CET 2006

I need to register for a COM  callback under Windows. I am using an ADO
recordset interface like this:

import win32com.client
import time
connect = win32com.client.Dispatch("ADODB.Connection")
recordset = win32com.client.Dispatch("ADODB.Recordset")
datestring = time.strftime("%m/%d/%Y")
sql = "Select * from VisSchedule where SDATE='" + datestring +"'"

Now I want to receive events for the recordset when the recordset
changes. Here is the IDL for the event:
HRESULT RecordsetChangeComplete(
                [in] EventReasonEnum adReason,
                [in] Error* pError,
                [in, out] EventStatusEnum* adStatus,
                [in] _Recordset* pRecordset);

How do I wire up the recordset I have created to receive this event?

More information about the Python-list mailing list