>ooo = NEWOBJECT([oCA]) >ooo.CursorFill() >APPEND BLANK >REPLACE name WITH [Test], forum WITH [TEST] >TABLEUPDATE(1,.t.) >BROWSE > > >************************************************** >*-- Class: oca (f:\testca\otest.vcx) >*-- ParentClass: cursoradapter >*-- BaseClass: cursoradapter >*-- Time Stamp: 06/27/07 12:40:06 AM >* >DEFINE CLASS oca AS cursoradapter > > > Tag = ['Provider=VFPOLEDB.1;Data Source=F:\TestCA\TestCA.DBC;Password="";Collating Sequence=MACHINE;'] > Height = 22 > Width = 23 > SelectCmd = "select forum, id, name from clients" > CursorSchema = "FORUM C(10), ID I, NAME C(10)" > Alias = "crsclients" > DataSourceType = "ADO" > Flags = 0 > WhereType = 1 > KeyFieldList = "ID" > Tables = "clients" > UpdatableFieldList = "FORUM, NAME" > UpdateNameList = "FORUM clients.forum, ID clients.id, NAME clients.name" > > InsertCmdRefreshFieldList = "ID" > InsertCmdRefreshKeyFieldList = "Id" > InsertCmdRefreshCmd = "SELECT Id FROM Clients WHERE Id = GETAUTOINCVALUE(0)" > Name = "oca" > > > PROCEDURE Init > *** Setup code: DO NOT REMOVE > local llReturn > do case > case not pemstatus(This, '__VFPSetup', 5) > This.AddProperty('__VFPSetup', 0) > case This.__VFPSetup = 1 > This.__VFPSetup = 2 > case This.__VFPSetup = 2 > This.__VFPSetup = 0 > return > endcase > set multilocks on > llReturn = dodefault() > *** End of Setup code: DO NOT REMOVE > *** Select connection code: DO NOT REMOVE > > local loConnDataSource > loConnDataSource = createobject('ADODB.Connection') > ***<DataSource> > loConnDataSource.ConnectionString = [Provider=VFPOLEDB.1;Data Source=F:\TestCA\TestCA.DBC;Password="";Collating] + ; > [ Sequence=MACHINE;] > ***</DataSource> > loConnDataSource.Open() > This.DataSource = createobject('ADODB.RecordSet') > This.DataSource.CursorLocation = 3 && adUseClient > This.DataSource.LockType = 3 && adLockOptimistic > This.DataSource.ActiveConnection = loConnDataSource > >******************** THESE ARE THE IMPORTANT SETTINGS > loConnDataComm = createobject('ADODB.Command') > loConnDataComm.ActiveConnection = loConnDataSource > this.InsertCmdDataSourceType = [ADO] > this.InsertCmdDataSource = loConnDataComm >***************************************** > *** End of Select connection code: DO NOT REMOVE > > *** Setup code: DO NOT REMOVE > if This.__VFPSetup = 1 > This.__VFPSetup = 2 > endif > return llReturn > *** End of Setup code: DO NOT REMOVE > ENDPROC > > > PROCEDURE AutoOpen > *** Setup code: DO NOT REMOVE > if not pemstatus(This, '__VFPSetup', 5) > This.AddProperty('__VFPSetup', 1) > This.Init() > endif > *** End of Setup code: DO NOT REMOVE > ENDPROC > > >ENDDEFINE >* >*-- EndDefine: oca >************************************************** >