all groups > sql server odbc > april 2004 >
You're in the

sql server odbc

group:

assigning user to a database programmatically


assigning user to a database programmatically Asif
4/24/2004 1:00:44 PM
sql server odbc:
Environment : vc.net , SQL Server
Hi All,

I have programmatically created an SQL Server database
by executing the script file for it. I have logged in as administrator
for creating the above database in my vc.net code using SQL APIs.

Now i need to assign a new user and pasword to this database
i have created in my program. Is there a way to do it ?

Regards,
Asif

RE: assigning user to a database programmatically Lance
4/25/2004 5:31:02 PM
Use sp_addlogin for adding the login to the database, then use sp_grantdbaccess to grant your user access to the database. If you then want to add the user to a role use sp_addrolemembe

hth
AddThis Social Bookmark Button