hello every 1 i am new to this forum i am having a lot of difficulty in giving privileges to login user. i am using vb.net and sql server 2008. What i want to do is i want to create an admin account . Admin will have all access on windows form. Than i want to register employees but employees going to have some privileges on viewing forms and option. i just dont know where to set these privilege. Is it going to be in sql server. Or how am i going to determine the new registered member is an admin or employee.Please reply any 1 i m in big need to this answer. i will be gratefull if you can answer step by step.

Recommended Answers

All 3 Replies

There are a couple of approaches. What I did at work depended on the application(s). If an application needed access to just one database then I would create two accounts in SQL server named APP_RO and APP_RW, where "APP" was replaced with the application name, and RO and RW denoted whether the access was read only or read/write. The database for that app usually had a userlist table with the name of the user who was logged onto the domain at the time the app was run, and an access level (typically user or admin). The name of the user was checked against the userlist table at startup. No reason why the userlist table should be restricted to only user or admin. Our river optimization app had multiple levels of access depending on the responsibilities of the particular system operator using it.

There are a couple of approaches. What I did at work depended on the application(s). If an application needed access to just one database then I would create two accounts in SQL server named APP_RO and APP_RW, where "APP" was replaced with the application name, and RO and RW denoted whether the access was read only or read/write. The database for that app usually had a userlist table with the name of the user who was logged onto the domain at the time the app was run, and an access level (typically user or admin). The name of the user was checked against the userlist table at startup. No reason why the userlist table should be restricted to only user or admin. Our river optimization app had multiple levels of access depending on the responsibilities of the particular system operator using it.

i am confused where to set these privilges on the tables. is gona b inside sql server or through vb.net script. the thing i am confused about is suppose i make user table in sql server. than i make a registration form in vb.net windows form. how would it determines during the registration that the user being created is admin or normal user.

Typically, the SQL server logins are created by the dbAdmin using the SQL Server Management Console under the Security -> Logins section of the tree. At least one app user should be set up as an admin type user. This person would be the one who will be able to add/modify/remove users from the userlist table.

Incidentally (I should have pointed this out before), if you use application accounts in SQL server then your application would have to have the connection strings available to get read or read/write access. If the userids/passwords are not encrypted then anyone with the appropriate tools could extract them from the exe file or from the in-memory process.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.