PROCEDURE AfterDelete LPARAMETERS cFldState, lForce, cDeleteCmd, lResult This.DataSource.MoveFirst() EndProcHere is "patched" repro code:
CLEAR CLOSE TABLES ALL SET MULTILOCKS ON Public loCAdapter As CursorAdapter Local loCon As ADODB.Connection loCon = Createobject("ADODB.Connection") loCon.Open("Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Data Source=(local)") IF MESSAGEBOX("Drop and recreate tables with new set of data?",4)=6 TRY loCon.Execute("DROP TABLE testchild") loCon.Execute("DROP TABLE testparent") CATCH ENDTRY loCon.Execute("create table testparent (id int primary key , descr varchar(20))") loCon.Execute("create table testchild (id int primary key , foreignkey int foreign key references testparent (id), somedata varchar(20))") loCon.Execute("insert into testparent values (1 ,'Parent1')") loCon.Execute("insert into testparent values (2 ,'Parent2')") loCon.Execute("insert into testchild values (1 ,1,'Child1')") loCon.Execute("insert into testchild values (2 ,1,'Child2')") loCon.Execute("insert into testchild values (3 ,2,'Child3')") loCon.Execute("insert into testchild values (4 ,2,'Child4')") ENDIF loCAdapter = Createobject("catest") loCAdapter.DataSourceType="ADO" loCAdapter.Datasource = Createobject('ADODB.RecordSet') loCAdapter.Datasource.CursorLocation = 3 && adUseClient loCAdapter.Datasource.LockType = 3 && adLockOptimistic loCAdapter.BufferModeOverride = 5 loCAdapter.Datasource.ActiveConnection = loCon loCAdapter.BreakOnError= .T. loCadapter.Alias = "caTest" llReturn = loCAdapter.RetrieveData() If !llReturn MessageBox(Message()) EndIf Select caTest LIST GO top delete all if !tableupdate(.T.) Messagebox(message()) TABLEREVERT(.T.) endif llReturn = loCAdapter.RetrieveData() If !llReturn MessageBox(Message()) EndIf Select caTest LIST Define Class caTest As cursoradapter Procedure selectcmd_assign Lparameters vNewVal This.SelectCmd = Chrtran(m.vNewVal, Chr(13) + Chr(10), "") EndProc Procedure retrievedata() Text To this.selectcmd Noshow textmerge Select testchild.id, testchild.foreignkey, testchild.somedata, testparent.descr from testchild, testparent where testparent.id = testchild.foreignkey EndText this.UpdatableFieldList = "id, foreignkey, somedata" this.UpdateNameList = "id testchild.id, foreignkey testchild.foreignkey, somedata testchild.somedata" this.Tables = "testchild" this.KeyFieldList = "id" Return this.CursorFill() EndProc Procedure aftercursorfill Lparameters lUseCursorSchema, lnoDataOnLoad, cSelectCmd, lResult This.DataSource.Properties("Unique Table") = this.Tables EndProc PROCEDURE AfterDelete LPARAMETERS cFldState, lForce, cDeleteCmd, lResult This.DataSource.MoveFirst() EndProc EnddefineThanks,