Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CDBManageForm modified to use SDT
Message
From
06/11/2000 21:03:14
 
 
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Miscellaneous
Thread ID:
00438334
Message ID:
00438648
Views:
13
>Rex,
>
>I can't find the code, but solution is simple. I use a combination of Kevin's code and my own to simplify things. Just follow the MM guide to load the Stonefield object as usual. Create a subclass of cdbmanageform called adbmanageform. Set the abstract factory reference in the classes table. In the doactions() method on the form, put the following code:
>
>
aLOCAL lnCounter, ;
>      loList, ;
>      lcTable, ;
>      lcSaveOnError
>
>PRIVATE pnError
>
>*-- First thing to do here will be to get a confirmation
>*-- of what they have elected to do.
>
>IF !YesNo(TAKELONG_LOC + " " + AREYOUSURE_LOC)
>  RETURN
>ENDIF
>
>loList = this.lstTables
>pnError = 0
>
>*-- A quick note here. pnError will have the number of an error that
>*-- occurs. If an error occurs when trying to open a table exclusively, the
>*-- ERROR() method will be called which will set the value of pnError.
>*--
>*-- I am assuming that an error greater than 0 means that we have a multi user
>*-- conflict...
>
>thisform.WaitMode(.T.)
>
>goApp.oMeta.SetDatabase(dbc())
>
>FOR lnCounter = 1 TO loList.ListCount
>  IF loList.Selected(lnCounter)
>    lcTable = loList.List(lnCounter)
>
>    SELECT (lcTable)
>
>    IF !ISEXCLUSIVE(lcTable)
>      lcSaveOnError = ON('ERROR')
>      ON ERROR pnError = Error()
>      USE DBF(lcTable) EXCLUSIVE
>      ON ERROR &lcSaveOnError
>    ENDIF
>
>    IF pnError > 0
>      =MsgSvc('FileInUseNotManaged', ALLTRIM(lcTable))
>      pnError = 0
>      LOOP
>    ENDIF
>
>    IF this.chkPack.Value = .T.
>      goApp.oMeta.oSDTMgr.Reindex(lcTable, .T.)
>    ELSE
>      IF this.chkPackMemo.Value = .T.
>        this.oTableBehavior.PackMemo()
>      ENDIF
>
>      IF this.chkReindex.Value = .T.
>        goApp.oMeta.oSDTMgr.Reindex(lcTable)
>      ENDIF
>    ENDIF
>
>    USE
>  ENDIF
>ENDFOR
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform