限制从应用程序访问数据库的用户数 [英] Limiting number of users accessing a database from an application

查看:63
本文介绍了限制从应用程序访问数据库的用户数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我们在SQL Server 2008 R2上有一个带有数据库的vb.net应用程序,例如10个客户端使用其唯一的用户ID访问数据库。



问题是我无法使用某种锁来阻止超过10个用户访问该应用程序。

我不希望15-20个用户访问我们的应用程序和购买仅10个用户的许可证副本。





提前致谢

Hi all,

We have a vb.net application with database on the SQL server 2008 R2 and for example 10 clients accessing the database with their unique userids.

The issue is I'm not able to apply some sort of a lock to prevent more than 10 users accessing the application.
I don't want 15-20 users accessing our application and purchasing license copy of only 10 users.


Thanks in advance

推荐答案

将登录列添加到users表(或另一个包含会话信息的表,这可能会更好)。用户登录时,更新此列或表,计算活动会话数。如果活动会话数>许可会话,向用户显示错误,说明他们已超过并发许可证。
Add a "logged in" column to your users table (or another table that holds session information, which would probably be better). When the user logs in, update this column or table, counting the number of active sessions. If the number of active sessions > licensed sessions, display an error to the user saying they've exceeded their concurrent licenses.


这篇关于限制从应用程序访问数据库的用户数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆