如何确定有多少人登陆数据库?
来源:程序员人生 发布时间:2014-03-31 09:25:52 阅读次数:3074次
Sub ShowUserRosterMultipleUsers()
Dim cn As New ADODBConnection
Dim cn As New ADODBConnection
Dim rs As New ADODBRecordset
Dim i j As Long
cnProvider = "MicrosoftJetOLEDB"
cnOpen "Data Source=c:Northwindmdb"
cnOpen "Provider=MicrosoftJetOLEDB;" _
& "Data Source=c:Northwindmdb"
; The user roster is exposed as a providerspecific schema rowset
; in the Jet OLE DB provider You have to use a GUID to
; reference the schema as providerspecific schemas are not
; listed in ADO;s type library for schema rowsets
Set rs = cnOpenSchema(adSchemaProviderSpecific _
"{bbddbdbfcfb}")
;Output the list of all users in the current database
DebugPrint rsFields()Name "" rsFields()Name _
"" rsFields()Name rsFields()Name
While Not rsEOF
DebugPrint rsFields() rsFields() _
rsFields() rsFields()
rsMoveNext
Wend
End Sub
生活不易,码农辛苦
如果您觉得本网站对您的学习有所帮助,可以手机扫描二维码进行捐赠