we have 3 databases and share a limited number of licenses across them.
I need to come up with a method to check the number of users before I allow another user to connect. Does somebody know how to do this?
There is no "one size fits all" solution to the problem.
You could use the _Connect VST or screen scrape ProMON to obtain the raw current connection counts. However, simply counting sessions is not necessarily the same as counting "users" for licensing purposes. For instance you probably shouldn't be counting the db broker, biw, aiw & apw processes. Nor woud you count servers for remote clients. And batch sessions may, or may not, count depending on various factors.
A lot depends on the particulars of your application and how licensing policy relates to it. Licensing policy varies significantly depending on Progress version and the source of your license -- if it is from a partner rather than a direct license the terms may be very different from PSC's standard terms.
Personally I prefer to go by the honor system with periodic self-audits to demonstrate compliance.
While all that Tom says is true, there are a lot of sites where a simple set of -n gets pretty close and is dead simple.
Consulting in Model-Based Development, Transformation, and Object-Oriented Best Practice http://www.cintegrity.com
It is also quite possibly the most common /(and most expensive) misinterpretation of licensing to equate -n to the licensed user count.
Reading between the lines a bit here I think the challenge has to do with dynamically balancing X users across 3 databases.