×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Number of users logged in

Number of users logged in

Number of users logged in

(OP)
How can you check how many users are logged into a Pervasive database?

Hopefully a list of users and how they are logged in (which application).

Pervasive 8.6

zemp

RE: Number of users logged in

Use the Pervasive Monitor (W3MONV75.EXE).  It's in the Active Users (MKDE) and Active Connections(SRDE).

Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
Custom VB and Btrieve development.
http://www.mirtheil.com

RE: Number of users logged in

(OP)
I got the following to work through VB using DTO objects.

CODE

Private Function Check_UserNumber() As Integer
'// Check the number of app users in the database.
   Dim result As dtoResult
   Dim dtoSess As DtoSession
   Dim SessMonitor As DtoMonitor
   Dim Clients As DtoSQLClients
   Dim SingleCl As DtoSQLClient
   Dim i As Integer

   Set dtoSess = New DtoSession
   result = dtoSess.Connect("<MyServer>", "", "")
   If result = Dto_Success Then
      Set SessMonitor = dtoSess.Monitor
      Set Clients = SessMonitor.SQLClients
      For i = 1 To Clients.Count
         Set SingleCl = Clients(i)
         If Trim$(SingleCl.AppDesc) = App.Title Then
            Check_UserNumber = Check_UserNumber + 1
         End If
         Set SingleCl = Nothing
      Next i
      Set Clients = Nothing
      Set SessMonitor = Nothing
   End If
   dtoSess.Disconnect
   Set dtoSess = Nothing
End Function
The main drawback is that you need a server name and /or user name and password. My app accesses the database mainly via ADO and I don't necessarilly have access to this information. The users might not either.

Is there any way that I could create a stored procedure so that I could check this through ADO?

zemp

RE: Number of users logged in

Nope.. Not through a Stored Procedure or DTO.  You should be able to get it through your ADO connection.  Use the COnnection String or read the DSN information.

Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
Custom VB and Btrieve development.
http://www.mirtheil.com

RE: Number of users logged in

(OP)
I'll look into it the ADO connection further. Any other insights are appreiciated.

zemp

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close