How to create SECURITY LOGIN from front-end coding

Thread Solved

Join Date: May 2007
Posts: 538
Reputation: choudhuryshouvi is an unknown quantity at this point 
Solved Threads: 49
choudhuryshouvi's Avatar
choudhuryshouvi choudhuryshouvi is offline Offline
Posting Pro

How to create SECURITY LOGIN from front-end coding

 
0
  #1
Mar 10th, 2008
i have a database called "BILLING_SYSTEM" in sql server 7.0 and I'm using sql server authentication mode to connect to the database with my username "BS" and password "BS".

where my front-end is a VB6.0 application.

now I want to create this security login "BS/BS" from vb6.0 code without opening the enterprise manager console.

so how can I accomplish that?
or is there any T-SQL command for creating users?

any help on this would be highly appreciated. I have already searched in google for many time and nothing got yet. if somebody has any link to any related resources that becomes helpful too.

help plz...........its urgent...

regards
Shouvik
Last edited by choudhuryshouvi; Mar 10th, 2008 at 4:47 am.
Shouvik_The_Expert_Coder
Have a problem? Don't worry just give me a call and I'll fix it for you.
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 483
Reputation: DangerDev has a spectacular aura about DangerDev has a spectacular aura about 
Solved Threads: 59
DangerDev's Avatar
DangerDev DangerDev is offline Offline
Posting Pro in Training

Re: How to create SECURITY LOGIN from front-end coding

 
0
  #2
Mar 10th, 2008
Freedom in the Mind, Faith in the words.. Pride in our Souls...
Indian Developer
http://falaque.wordpress.com/
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 538
Reputation: choudhuryshouvi is an unknown quantity at this point 
Solved Threads: 49
choudhuryshouvi's Avatar
choudhuryshouvi choudhuryshouvi is offline Offline
Posting Pro

Re: How to create SECURITY LOGIN from front-end coding

 
0
  #3
Mar 10th, 2008
well this didn't work in sql server 7.0.
your linked article points me to sql server 2005 t-sqls which i donot require at this moment. i wish to do this job in 7.0 version. so, could you give me a sample code?
Shouvik_The_Expert_Coder
Have a problem? Don't worry just give me a call and I'll fix it for you.
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 538
Reputation: choudhuryshouvi is an unknown quantity at this point 
Solved Threads: 49
choudhuryshouvi's Avatar
choudhuryshouvi choudhuryshouvi is offline Offline
Posting Pro

Re: How to create SECURITY LOGIN from front-end coding

 
0
  #4
Mar 16th, 2008
Ok i have figured this out.

thanks to the replied person and all who have paid visit to see this thread.

now this thread is closed.
bye.......
Shouvik_The_Expert_Coder
Have a problem? Don't worry just give me a call and I'll fix it for you.
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 4,278
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 494
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: How to create SECURITY LOGIN from front-end coding

 
0
  #5
Mar 17th, 2008
Would you mind to share your solution as other people can have similar problem too...
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 538
Reputation: choudhuryshouvi is an unknown quantity at this point 
Solved Threads: 49
choudhuryshouvi's Avatar
choudhuryshouvi choudhuryshouvi is offline Offline
Posting Pro

Re: How to create SECURITY LOGIN from front-end coding

 
1
  #6
Apr 5th, 2008
Its been a pleasure to share my code here.
This is the code which I used in my application. Hope others will be benefited from this having same problem like me.

''this is for creating the user "BS" and associate it with the "BILLING_SYSTEM database
EXEC SP_ADDLOGIN 'BS','BS','BILLING_SYSTEM'
USE BILLING_SYSTEM
''these are for granting server roles
EXEC SP_ADDSRVROLEMEMBER 'BS', 'sysadmin'
EXEC SP_ADDSRVROLEMEMBER 'BS', 'securityadmin'
EXEC SP_ADDSRVROLEMEMBER 'BS', 'serveradmin'
EXEC SP_ADDSRVROLEMEMBER 'BS', 'setupadmin'
EXEC SP_ADDSRVROLEMEMBER 'BS', 'processadmin'
EXEC SP_ADDSRVROLEMEMBER 'BS', 'diskadmin'
EXEC SP_ADDSRVROLEMEMBER 'BS', 'dbcreator'
''these are for granting various database manipulation permissions
EXEC SP_ADDUSER 'BS','BS','public'
EXEC SP_ADDROLEMEMBER 'db_owner','BS'
EXEC SP_ADDROLEMEMBER 'db_accessadmin','BS'
EXEC SP_ADDROLEMEMBER 'db_securityadmin','BS'
EXEC SP_ADDROLEMEMBER 'db_ddladmin','BS'
EXEC SP_ADDROLEMEMBER 'db_backupoperator','BS'
EXEC SP_ADDROLEMEMBER 'db_datareader','BS'
EXEC SP_ADDROLEMEMBER 'db_datawriter','BS'
EXEC SP_ADDROLEMEMBER 'db_denydatareader','BS'
EXEC SP_ADDROLEMEMBER 'db_denydatawriter','BS'

Hope the above syntax will be acceptable and one more thing i must say this code is working like snapping knife in butter.

regards
Shouvik
Shouvik_The_Expert_Coder
Have a problem? Don't worry just give me a call and I'll fix it for you.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the MS SQL Forum


Views: 2331 | Replies: 5
Thread Tools Search this Thread



Tag cloud for MS SQL
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC