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
 Development Tools
 Other Development Tools
 Changing of permissions to roles and users ( programming)

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-05-27 : 10:42:23
Navin writes "Hi,
I have to change the Grant/Revoke permmissions to roles/users usnig vbscript.
How it can be done."

timmy
Master Smack Fu Yak Hacker

1242 Posts

Posted - 2004-05-27 : 21:18:23
Probably the easiest is to create an ADO connection object and execute GRANT and REVOKE statements against it:

Dim cn

set cn = CreateObject("ADODB.Connection")
cn.Open yourConnectionString
cn.Execute "GRANT SELECT ON Table1 To Navin"
etc
etc
etc
cn.Close

But - you'll need to make sure that the user specified in the connection string has the required admin rights to the database.

HTH,

Tim
Go to Top of Page
   

- Advertisement -