Michael,

I do it through a simple 1 line bat file, but this code must be run from the 
server, from there I import the text file into a RBase table, and I know who is 
on, Here is the code I use

Openfiles.bat Code -

OPENFILES /QUERY /FO CSV >> D:\ARAHO91\OPENFILES.TXT

In Rbase I do this to get it into a table


--Creates List from server
  SET VAR vcomspec = (ENVVAL('COMSPEC'))
  ZIP &VCOMSPEC /C userlist.bat

--Loads RBase Table openfiles
  LOAD openfiles FROM openfiles.txt AS CSV

--Creates a Text files of those that are in the database I want to know about  
filepath is where I tell it which Database to report on
  SET VAR vnsendtxt = (' NET SEND * Automated Backup Warning - FOLLOWING USERS 
STILL ONLINE -')

  DROP CURSOR c1
  DECLARE c1 CURSOR FOR SELECT accessedby FROM openfiles WHERE filepath = 
'D:\ARAHOV91\ARAHO.RX1' GROUP BY accessedby
  OPEN c1
  SET VAR vcount = 1
  WHILE 1 = 1 THEN
    FETCH c1 INTO vaccessed IND vi
    IF SQLCODE = 100 THEN
      BREAK
    ENDIF
    SET VAR vnsendtxt = (.vnsendtxt + .vaccessed + '-')

  ENDWHILE

  DROP CURSOR c1

Here is the structure of the RBase table I use to load the user list.

   Table: Openfiles              No Lock(s)
   Descr: List of openfiles on the server

No. Column Name          Attributes
   1 ID                   Type   : TEXT 15
   2 Accessedby           Type   : TEXT 60
   3 TypeOS               Type   : TEXT 25
   4 Filepath             Type   : TEXT 100

Hope that helps


n  Frank

Frank Taylor - Director of Information Technology
F.J. O'Hara & Sons,  Inc - Araho Transfer Inc.
Boston, MA - Rockland, ME - Miami, FL
Direct Dial - 617-790-3093
email: 
[email protected]<http://mail.whitewolftechnologies.com/cgi-bin/compose.exe?id=01ef7f9322f8a76400dacb6a1fe342bb5a7&new=&xsl=compose.xsl&[email protected]>

From: [email protected] [mailto:[email protected]] On Behalf Of Michael J. 
Sinclair
Sent: Monday, July 30, 2012 6:22 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Re: how to capture the number of users on a network

I was hoping to do so from within a command file.
Mike

________________________________
From: Dan Goldberg <[email protected]<mailto:[email protected]>>
To: RBASE-L Mailing List <[email protected]<mailto:[email protected]>>
Sent: Monday, July 30, 2012 6:07 PM
Subject: [RBASE-L] - Re: how to capture the number of users on a network

You can use rbadmin.

http://www.rbaseadmin.com/

Dan

From: Michael J. Sinclair<mailto:[email protected]>
Sent: Monday, July 30, 2012 2:39 PM
To: RBASE-L Mailing List<mailto:[email protected]>
Subject: [RBASE-L] - Re: how to capture the number of users on a network
Is there a similar function to determine the name(s) of the users that are 
connected?
Mike

________________________________
From: A. Razzak Memon <[email protected]<mailto:[email protected]>>
To: RBASE-L Mailing List <[email protected]<mailto:[email protected]>>
Sent: Monday, July 30, 2012 4:40 PM
Subject: [RBASE-L] - Re: how to capture the number of users on a network

At 03:59 PM 7/30/2012, mike epstein sony viao office wrote:

>Is there a function that could be used to capture the number of
>users on a network?
>
>SET VAR vcheckusers  INTEGER =?  (???????(??????))


Mike,

You mean the number of users on a network, connected to a shared
database?  Correct?

If that is the case...

Here's how:

SET VAR vConnections INTEGER = 0
SET VAR vConnections = (INT(CVAL('CONNECTIONS')))

The resulting value (vConnections) will return the number of concurrent R:BASE
connections/sessions/users to a CONNECTed database.

That's all there is to it!

Very Best R:egards,

Razzak.

www.rbase.com<http://www.rbase.com/>
www.facebook.com/rbase<http://www.facebook.com/rbase>




Reply via email to