*-- Code start PUBLIC oform oform=CreateObject("Testform") oform.Show Read Events RETURN *-- DEFINE CLASS Testform AS form Caption = "TestForm" Name = "TestForm" ADD OBJECT ExitForm AS commandbutton WITH ; Top = 10, ; Left = 10, ; Height = 30, ; Width = 75, ; Caption = "Exit", ; Name = "ExitForm" ADD OBJECT myclass1 AS myclass WITH ; Name = "Myclass1" PROCEDURE ExitForm.Click Release Thisform Clear Events ENDPROC ENDDEFINE *-- DEFINE CLASS myclass AS custom ovfpcom = .NULL. ors = .NULL. orsclass = .NULL. Name = "myclass" PROCEDURE Destroy this.ovfpcom.UnBindEvents(this.oRS, this.orsclass) this.oRS = .NULL. this.orsclass = .NULL. this.ovfpcom = .NULL. ENDPROC PROCEDURE Init this.ovfpcom = CreateObject("vfpcom.comutil") this.orsclass = CreateObject("RecorsetClass") this.oRS = CreateObject("ADODB.Recordset") this.ovfpcom.BindEvents(this.oRS, this.orsclass) ENDPROC ENDDEFINE *-- DEFINE CLASS recorsetclass AS custom Name = "recorsetclass" ENDDEFINE *-- *-- Code end