Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count connections to my 2007 database 1

Status
Not open for further replies.

mutley1

MIS
Joined
Jul 24, 2003
Messages
909
Hey Experts,

Just a quick question. I have a DB on a drive and the front end is on everyone’s machines (Access 2007). Is there a way I can add a table to the database that counts how many people log in - or not even a table maybe, just a way to see amount of connections? I want to get an idea of how many people use the database on a daily basis. I can reset the numbers myself no prob, but wondered if there was a way to count connections made to it. There is no security like logines etc. Do you know if this is possible?

Thanks,

M.
 
Perhaps something like this may suit:

Code:
  Public Sub ADOUserList(oConn As ADODB.Connection)
  Dim rs As ADODB.Recordset
      Set rs = oConn.OpenSchema(adSchemaProviderSpecific, , "{947bb102-5d43-11d1-bdbf-00c04fb92675}")
      Debug.Print rs.GetString
      rs.Close
  End Sub

More information:
 
Thanks Remou - sorry, i am a total novice in access (no idea how i managed to build the db & front end forms!!!). where would I put that code and where would i look for the results during the middle of the day to see the amount of connections - or is that something to run now to see who is connected at the moment?

Thx,

M.
 
Paste the code above into a module in the database you want connection for, save, press ctrl+g to show the immediate window and paste this line into the immediate window and press return:

ADOUserList Currentproject.Connection


You should get a list of user names and computer names. You can run this when ever you like.

 
Thanks very much for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top