"Dan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
>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")
> connect.Open("Driver={SQLServer};Server=devserver;Database=VidVisitation;UID=sa;PWD=;")
> datestring = time.strftime("%m/%d/%Y")
> sql = "Select * from VisSchedule where SDATE='" + datestring +"'"
> recordset.Open(sql,connect)
>
> Now I want to receive events for the recordset when the recordset
> changes. Here is the IDL for the event:
> [id(0x0000000e)]
> 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?
>
Use win32com.client.DispatchWithEvents, and create a class that
implements the event methods defined for the Recordset object.
You can find prototypes for the methods in the makepy-generated
file.

          Roger




----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet 
News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 
Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to