如何确定有多少人登陆Access数据库?
Sub ShowUserRosterMultipleUsers()
Dim cn As New ADODB.Connection
Dim cn2 As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim i, j As Long
cn.Provider = "Microsoft.Jet.OLEDB.4.0"
cn.Open "Data Source=c:/Northwind.mdb"
cn2.Open "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=c:/Northwind.mdb"
' The user roster is exposed as a provider-specific schema rowset
' in the Jet 4 OLE DB provider. You have to use a GUID to
' reference the schema, as provider-specific schemas are not
' listed in ADO's type library for schema rowsets
Set rs = cn.OpenSchema(adSchemaProviderSpecific, _
, "{947bb102-5d43-11d1-bdbf-00c04fb92675}")
'Output the list of all users in the current database.
Debug.Print rs.Fields(0).Name, "", rs.Fields(1).Name, _
"", rs.Fields(2).Name, rs.Fields(3).Name
While Not rs.EOF
Debug.Print rs.Fields(0), rs.Fields(1), _
rs.Fields(2), rs.Fields(3)
rs.MoveNext
Wend
End Sub
(责任编辑:admin)
- ·两个未公开的ACCESS方法的使用技巧
- ·如何拆分复制的Access 97数据库
- ·两个未公开的ACCESS方法的使用技巧
- ·用Access 2000有效地组织班级管理
- ·数据在Access与Office组件间自由流动
- ·Access"智库"培训--高效设计 敏捷开
- ·Access查询的基本知识(二)(Office免费
- ·Access设置宏的安全等级
- ·Access查询的基本知识(Office免费公开
- ·四种用代码打开外部Access(MDB)的方法
- ·access操作或事件已被禁用模式阻止的解
- ·简述vba字符串,函数,表达式等基础术
- ·Access VBA 开发公开课讲座
- ·Access设置信任位置
- ·Access应用程序应注意的几个问题
- ·简析能判断Access版本的窗体