/获取josn对象 串长度_获取对象的访问信息/状态

/获取josn对象 串长度

在技​​巧12中,我们展示了如何使用SysCmd()函数在Access中显示进度表。 现在,通过使用具有不同操作参数的相同功能,我们将演示如何返回特定的访问信息以及确定对象(表,窗体,报表,宏,模块等)的状态。 我决定不对代码显示进行概述,而是决定对代码进行更充分的注释,因为在大多数情况下,代码将是自解释的。 然后将显示示例输出,以演示代码的最终结果。

  1. 检索访问特定信息
    Debug.Print "1) The Main Access Directory is: " & SysCmd(acSysCmdAccessDir)
    Debug.Print "2) The Access Version is: " & SysCmd(acSysCmdAccessVer)
    Debug.Print "3) The Path to the Access Woekgroup File is: " & SysCmd(acSysCmdGetWorkgroupFile)
    Debug.Print "4) The Name of the .ini File associated with Access is: " & SysCmd(acSysCmdIniFile)
    Debug.Print "5) Is this Version of Access the Runtime Version?: " & IIf(SysCmd(acSysCmdRuntime), "Yes", "No")
    Debug.Print "6) The /profile setting specified by the user when starting Microsoft Access from the command line: " & IIf(IsNull(SysCmd(acSysCmdProfile)), "None Specified", SysCmd(acSysCmdProfile))
    输出值
     The Main Access Directory is: C:\Program Files\Microsoft Office\Office\
    The Access Version is: 9.0
    The Path to the Access Woekgroup File is: C:\PROGRA~1\MICROS~2\Office\SYSTEM.MDW
    The Name of the .ini File associated with Access is: msacc30.ini
    Is this Version of Access the Runtime Version?: No
    The /profile setting specified by the user when starting Microsoft Access from the command line: None Specified
    ------------------------------------------
  2. 要确定访问对象的状态:
    ObjectState = SysCmd(action[, objecttype][, objectname])
    'objecttype can be 1 of the following:
    'acTable, acQuery, acForm, acReport, acMacro,
    'acModule, acDataAccessPage, acDefault, 
    'acDiagram, acServerView, acStoreProcedure 
    'An Object can be in one of four possible states or variations thereof:
    'return Value of 0 = not open or non-existent
    'acObjStateOpen = 1
    'acObjStateDirty = 2 (Changed but not saved )
    'return Value of 3 = Open and Dirty
    'acObjStateNew = 4
    'return Value of 5 = Open and New
    'return Value of 7 = Open, Dirty, and New 
    Debug.Print "State of Form3: " & SysCmd(acSysCmdGetObjectState, acForm, "Form3")
    Debug.Print "State of rptFinance: " & SysCmd(acSysCmdGetObjectState, acReport, "rptFinance")
    Debug.Print "State of tblEmployee: " & SysCmd(acSysCmdGetObjectState, acTable, "tblEmployees")
    Debug.Print "State of qryCustomers: " & SysCmd(acSysCmdGetObjectState, acQuery, "qryCustomers")
    Debug.Print "State of mcrOpenDatabase: " & SysCmd(acSysCmdGetObjectState, acMacro, "mcrOpenDatabase")
    Debug.Print "State of mdlUtilities: " & SysCmd(acSysCmdGetObjectState, acModule, "mdlUtilities")
  3. 输出值
    State of Form3: 1 (Open)
    State of rptFinance: 0 (Not Open or Non-Existent)
    State of tblEmployee: 5 (Open and New)
    State of qryCustomers: 3 (Open and Dirty)
    State of mcrOpenDatabase: 7 (Open, Dirty, and New)
    State of mdlUtilities: 0] (Not Open or Non-Existent)

翻译自: https://bytes.com/topic/access/insights/649352-obtain-access-information-state-object

/获取josn对象 串长度

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值