Sql Users and Application Users

lucasite

Member
Joined
Dec 1, 2004
Messages
8
Programming Experience
3-5
Hi there,

Im writing a large application that will connect to an SQL server. It will run Stored Procedures that sit on the server. My question is about users.

When people generally write applications like this. Do they create a generic user to actually login to the sql server, and like hardcode that user into the application/connection string. then define their own users/roles and what they can access within their application.

Or....

Actually create users in SQL aswell as users in their application.
If this is the case, is there an easy method of making your own application update the main SQL users database when you add users? or are you forced to do this via Enterprise Manager everytime someone new comes along?

Any response gratefully appreciated.
 

DavidT_macktool

Well-known member
Joined
Oct 21, 2004
Messages
502
Location
Indiana
Programming Experience
3-5
I control everything at the server for security purposes. Each time I add a Computer/user I have to set up a user account for the domain anyway. I also set up a user account for SqlServer at the same time and set permissions there. In the project I use the option for windows logon for SQLServer access and it seems to work fine when distributed to the different users. Security is controlled at the server and not coded into the project.
 

lucasite

Member
Joined
Dec 1, 2004
Messages
8
Programming Experience
3-5
Thanks for the reply David.

But just a quick question. In your situation, how do you then deal with features within your project. for example, whether a user can see a menu option or button?
 

DavidT_macktool

Well-known member
Joined
Oct 21, 2004
Messages
502
Location
Indiana
Programming Experience
3-5
I don't do a lot of that kind of functionality. I would probably create an initial logon form with password and set some sort of global booleen variable to true or false (in a case structure) depending on the logon. Menu options and button visability properties could then be set depending on the booleen variable in an if statement at form load.

ex:
Public management AsBoolean
Public LimitedAccess AsBoolean

If management = true then
btnEditGrid.Visible = true
else
btnEditGrid.Visible = False
end if

Hope that gives you some ideas.

 
Top Bottom