>DEFINE CLASS _ado AS cursoradapter > > > Tag = "Provider=VFPOLEDB.1;Data Source=;" > Height = 22 > Width = 23 > Alias = "cursor1" > BufferModeOverride = 3 > DataSourceType = "ADO" > Flags = 0 > WhereType = 1 > KeyFieldList = "" > UpdatableFieldList = "" > UpdateNameList = "" > AllowSimultaneousFetch = .T. > Name = "_ado" > > > PROCEDURE BeforeCursorFill > LPARAMETERS luseCursorSchema, lNoDataOnLoad, cSelectCmd > Local cSelect > > lUseCursorSchema = .F. > > With This > .CursorSchema = "" > .UpdatableFieldList = "" > .UpdateNameList = "" > Endif > EndWith > > DODEFAULT(luseCursorSchema, lNoDataOnLoad, cSelectCmd) > ENDPROC > > > PROCEDURE AfterCursorFill > LPARAMETERS luseCursorSchema, lNoDataOnLoad, cSelectCmd, lResult > cAlias = This.Alias > > If Used(cAlias) And Empty(This.UpdatableFieldList) > For nn=1 To Fcount() > If !Empty(This.UpdatableFieldList) > This.UpdatableFieldList = This.UpdatableFieldList + " , " > Endif > This.UpdatableFieldList = This.UpdatableFieldList + Field(nn) > If !Empty(This.UpdateNameList) > This.UpdateNameList = This.UpdateNameList + " , " > Endif > This.UpdateNameList = This.UpdateNameList + Field(nn) + " " + cAlias + "." + Field(nn) > EndFor > Endif > ENDPROC > > > 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=C:\Program Files\App\Data;Mod] + ; > [e=ReadWrite;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 > *** 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: _ado >************************************************** > > >