•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the MS SQL section within the Web Development category of DaniWeb, a massive community of 423,775 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,532 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS SQL advertiser: Programming Forums
Views: 1180 | Replies: 5 | Solved
![]() |
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
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 3:47 am.
Shouvik_The_Expert_Coder
Have a problem? Don't worry just give me a call and I'll fix it for you.
Have a problem? Don't worry just give me a call and I'll fix it for you.
•
•
Join Date: Jan 2008
Location: Bangalore, India
Posts: 336
Reputation:
Rep Power: 0
Solved Threads: 32
use CREATE USER
A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila.
~Mitch Ratcliffe
~Mitch Ratcliffe
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?
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.
Have a problem? Don't worry just give me a call and I'll fix it for you.
•
•
Join Date: Dec 2004
Location: London or Slovakia
Posts: 2,434
Reputation:
Rep Power: 11
Solved Threads: 295
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.
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
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.
Have a problem? Don't worry just give me a call and I'll fix it for you.
![]() |
•
•
•
•
•
•
•
•
DaniWeb MS SQL Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
advice antivirus apple botnet browser business coding crime daniweb data development email encryption firefox forensic google hacking help information internet linux malware mcafee michael knight microsoft mobile mozilla news phishing privacy report research satnav scam search security software spam spyware survey terrorism thunderbird trends trojan virus vista web webmail windows worm
- Previous Thread: query mdf directly?
- Next Thread: proble with import from excel



Linear Mode