Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 SQL Server Logins/Roles and VB

Author  Topic 

SimonGough
Starting Member

23 Posts

Posted - 2001-12-06 : 10:58:47

Hi Just wondering....

I am developing a system in VB and SQL Server 7.

I have a bunch of users in my SQL DB and they have roles. I can connect to the database ok by setting up a connection string via what the user entered for their username, password and DSN.

What I need to know is this:
Is there an easy way of creating new users (in the SQL Server Logins), assigning them a role and then reading this role whenever a user logs into my system so that I can set up the front end to suit their particular role????

If I did say have some kind of stored procedure to create a user, how could I pull the role names from the DB to populate a drop-down on the front end in the 'New User' form??

Or am i better off just having some kind of a standard connection string (what would this be?) and processing users/user levels via tables in my database?

Thanks for any help. This is driving me slowly mad!

Simon Gough

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2001-12-06 : 22:27:12
Hi

Opinions vary on this one. I prefer to have one connection string for my application and manager users and permissions within the application.

There is a topic on this here http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=9971



Damian
Go to Top of Page

SimonGough
Starting Member

23 Posts

Posted - 2001-12-07 : 04:54:02

Ok, I have read the discussion you linked to but I have a couple more questions.

I have a single connection string using a user with only select on table and execute on sprocs. This connection will be the same throughout. How will anyone using the system be able to add/update/delete table data? Surely, if they are using a users table to login to the system they will only have the permissions that the user in the original connection string have attributed to them???
Am I just confusing things?

I was reading up last night and have found that I can use commands like sp_addlogin, sp_adrolemember etc.. to add users with parameters passed to a sproc...is that a bad way of doing it? I just want to be sure of my options.

Thanks for your help,
Simon.



Go to Top of Page
   

- Advertisement -