您好,欢迎访问一九零五行业门户网

怎样确定有多少人登陆数据库

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=mic
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

其它类似信息

推荐信息