adataenv.prg

来自「MSComm控件资料,Visual Basic 6.0(以下简称VB) 是一种功」· PRG 代码 · 共 56 行

PRG
56
字号
#INCLUDE 'INCLUDE\APPINCL.H'

*==================================================*
*==        Application Data Environments         ==*
*==================================================*
*----------
*-- DBPATHS
*----------

*==================================================
DEFINE CLASS DBPathsEnvironment AS cDataEnvironment
*==================================================
   cDefaultDatabaseName   = ""
   cDefaultLocalLocation  = ""
   cDefaultRemoteLocation = ""
   lError                 = .F.
   *--------------
   FUNCTION Init()
   *--------------
      LOCAL llRetVal
      
      llRetVal = cDataEnvironment::Init(.T.)
      
      llRetVal = llRetVal AND .NOT. THIS.lError
      
      RETURN llRetVal
      
   ENDFUNC

   *---------------------
   FUNCTION LoadCursors()
   *---------------------
      DIMENSION this.aCursors[1]
      this.aCursors[1] = 'DBPaths'
   ENDFUNC

   *---------------------------------------
   FUNCTION Error( nError, cMethod, nLine )
   *---------------------------------------
      IF nError = 1995
         =MESSAGEBOX("The DBPATHS.DBF is in use an cannot be modified, make sure everyone is out of the application before trying to set application default database paths.")
      ENDIF
      
      THIS.lError = .T.
   ENDFUNC

ENDDEFINE

*=======================================
DEFINE CLASS DBPaths AS CFreeTableCursor
*=======================================
   CursorSource       = "DBPATHS.DBF"
   BufferModeOverride = 5
   
ENDDEFINE

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?