09-12-2007, 03:56 PM
can any one do me a favor and tell in steps what should i do to solve this problem:
i finished my database and connected it to VB 2005 code and it works great,but now i want to make the access to it by user name and password .so i created anew login in my server.. now i want to
1-encrypt the database or i don know just make it closed when it's transfered to the client computer
2-make the code access the server or the database through this login account only
3-make the client through code only execute procedures in database and nothing else.......
so how to make the whole story work:confused:
09-15-2007, 01:01 AM
Depending on the database if it is SQL Server, then you can create a role and set the permissions on each table, view or stored procedure for that role to allow the user to only do what you want to allow them to do.
09-17-2007, 03:28 PM
i tried to create a role and used the name and pass of it in my program
but it seems the program doesn't feel it at all and even when i use the name of the role with a wrong pass it still work and doesn't give errors
09-18-2007, 02:34 PM
the program i'm working on is not gonna finish
the problem is i made aprogram in vb.net which connects to adata base and the program is working so good while compiling in visual studio but when i try to run the exe file it gives me alot of errors concerning duplicate names and logical file and i don understand what's wrong
09-18-2007, 06:52 PM
first what database application are you using? you will need to post it here.
after that since my ESP is not working - and i'm not sure how many other people even have ESP - perhaps you could even show us some problematic code instead of having us guess.
Failing that I'm sure you won't get a response.
09-18-2007, 10:44 PM
ok can i send u the program on ur mail?? just to know by urself what are the errors
09-19-2007, 04:57 PM
Is this a SQL server Database? IF yes then you can do all of this in Enterprise Manager.
Select the database in the left pane and expand it to show all of the objects, click users and make sure that the user is listed in the right pane, if not add the user for the IUSR account. (or the login name) then click roles right clicking on it will give a list of options one being New Database Role... clicking on that will bring up a wizard allowing you to enter the name of the role, to add users to the role you click the Add... button select the user from the list and Click OK to add the user to the role now click OK to add the role. Now that the role has been created you can set the permissions on the tables or stored procedures.
Select the role, right click on it, then click properties, then click permissions now check the appropriate boxes for the permissions you want to grant for each table and or stored procedure listed.
If you do not have access to Enterprise Manager then you can create the login and the role through Script. This is more complicated than through Enterprise Manager but it can be done.
1st you need to create the login to the database. this can be done using a built in stored procedure 'sp_grantlogin'
EXEC sp_grantlogin N'InsertYourLoginNameHere'
Now that you have the login created you can create the role by using a built in stored procedure 'sp_addrole'
EXEC sp_addrole N'insert_role_name_here'
Now that you have the role you need to assign the rolemember using another built in stored procedure 'sp_addrolemember'
EXEC sp_addrolemember N'insert_role_name_here', N'Insert_Login_name_here'
Next you need to grant permissions for the tables and or stored procedures to run.
Tables are granted permission like this
GRANT SELECT ON [TableName] TO [role_name]
GRANT UPDATE ON [TableName] TO [role_name]
GRANT DELETE ON [TableName] TO [role_name]
Stored Procedures are granted permission like this
GRANT EXECUTE ON [stored_procedure_name] TO [role_name]
09-22-2007, 02:32 PM
oh i didn't do all of that!!
thank u so much for helping ,i ll do what u say and i hope to do it right