(CVAL('CONNECTIONS'))
Returns the number of users currently connected to the current database or 0 if not connected. In the event of a non-graceful disconnect R:BASE will not be able to decrement the connections count. This can occur if the network session terminates unexpectedly, or if the users operating system crashes. If this happens the count will be inaccurate until all users disconnect from the database. This works because the last session of R:BASE will be able to tell that NO users are connected and will reset the count to zero. Unfortunately, due to file system limitations, R:BASE is only able to tell if a database is open by any users or not at all, and is not able to tell, except by this count, how many users are connected.