打开 Microsoft SQL Server 数据库中的用户定义函数以便在 Microsoft Access 中查看。
语法
表达式。OpenFunction (FunctionName、 View、 DataMode)
expression:表示 DoCmd 对象的变量。
参数
名称 | 必需/可选 | 数据类型 | 说明 |
---|---|---|---|
FunctionName | 必需 | Variant | 要打开的函数的名称。 |
View | 可选 | AcView | 一个 AcView 常量,该常量指定要在其中打开函数的视图。 默认值为 acViewNormal。 |
DataMode | Optional | AcOpenDataMode | AcOpenDataMode 常量,指定打开函数的模式。 默认值为 acEdit。 |
备注
使用 AllFunctions 集合检索 SQL Server 数据库中的可用用户定义函数的信息。
示例
以下示例在设计视图和只读模式下打开当前数据库中的第一个用户定义函数。
Dim objFunction As AccessObject
Dim strFunction As String
Set objFunction = Application.AllFunctions(0)
DoCmd.OpenFunction FunctionName:=objFunction.Name, _
View:=acViewDesign, Mode:=acReadOnly
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。