使用Jet UserRoster判断谁登陆了Access2002/2003数据库
时间:2005-02-06 02:02 来源:Microsoft 作者:Microsof… 阅读:次
原文:http://support.microsoft.com/kb/285822
How to determine who is logged on to a database by using Microsoft Jet UserRoster in Access 2002 or in access 2003
Article ID | : | 285822 |
Last Review | : | August 30, 2004 |
Revision | : | 1.0 |
This article was previously published under Q285822
For a Microsoft access 2000 version of this article, see 198755.
Advanced: Requires expert coding, interoperability, and multiuser skills.
This article applies only to a Microsoft access database (.mdb).
Advanced: Requires expert coding, interoperability, and multiuser skills.
This article applies only to a Microsoft access database (.mdb).
IN THIS TASK
• | SUMMARY | ||
|
SUMMARY
This article shows you how to use Microsoft Visual Basic for Applications to output a list of users who are logged onto a database.
Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and the tools that are used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. If you have limited programming experience, you may want to contact a Microsoft Certified Partner or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Partners, visit the following Microsoft Web site: For additional information about the support options available from Microsoft, visit the following Microsoft Web site: When you use the following sample code, the following information is returned:
This information can also be used to isolate problems with database corruption that is associated with the activities of a specific user.
back to the top
back to the top
Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and the tools that are used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. If you have limited programming experience, you may want to contact a Microsoft Certified Partner or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Partners, visit the following Microsoft Web site: For additional information about the support options available from Microsoft, visit the following Microsoft Web site: When you use the following sample code, the following information is returned:
• | Computer name. |
• | Logon name. |
• | Whether or not the user is currently connected to the database. (A user's ID remains in the lock database until the last user disconnects or until the slot is reclaimed for a new user connection.) |
• | Whether or not the user connection was terminated under normal circumstances. |
back to the top
Procedure
To determine who is logged onto a database, follow these steps:1. | CAUTION: If you follow the steps in this example, you modify the sample database Northwind.mdb. You may want to back up the Northwind.mdb file and follow these steps on a copy of the database. |
2. | Open the sample database, Northwind.mdb. |
3. | On the View menu, point to Database Objects, and then click Modules. |
4. | Click New. |
5. | Type or paste the following code:
|
6. | Save the module as ShowUsers. |
7. | Close and then reopen the database. |
8. | Press CTRL+G to open the Immediate Window. |
9. | Type the following line in the Immediate window, and then press ENTER: Note that the Immediate window returns a list of users who are logged onto the database. |
APPLIES TO
• | Microsoft Office access 2003 |
• | Microsoft access 2002 Standard Edition |
• | Microsoft Visual Basic for Applications 6.0 |
Keywords: |
kbhowtomaster KB285822 |
(责任编辑:admin)
顶一下
(0)
0%
踩一下
(0)
0%
相关内容
- ·用DAO或ADO正确访问Access 2000
- ·Access开发网络共享版技巧(多人同时操
- ·access中ADO与DAO格式的区别和写法【总
- ·access执行操作查询的几种方法对比
- ·Access中CurrentDb().Execute 和DoCmd.
- ·[源创技巧]在ACCESS中使用代码来自动创
- ·更新访问权限 (Jet) 数据库中的 40 多
- ·【实例】ADO代码计算余额法
- ·DAO实现的子窗体记录分页显示
- ·分别使用DAO和ADO连接外部数据库和Sql
- ·怎样判断一个表是否存在于数据库中? (D
- ·处理加了密码的MDB文件
- ·谈ADO访问不同数据库的差别
- ·DAO基础(4)
- ·DAO基础(3)
- ·DAO基础(2)
最新内容
推荐内容