This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: SQL Server 2005 - create sql standard user
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Nov 03, 2008
10:29 PM
SQL Server 2005 - create sql standard user
Hi,
The following code used to create a Standard SQL account in SQL 2000. Similar code to create NT account still works. But now it is failing. I have switched to IS 2009. Is there a new way to create a SQL Server Standard account?
Code
-------
function CreateSQLUser(szServerName, szUserName, szPassword, szLoginType, bVerbose)
OBJECT oSQLServer, oLogin, oSQLRole;
begin
set oSQLServer = CreateObject('SQLDMO.SQLServer');
oSQLServer.LoginSecure = TRUE;
oSQLServer.Connect ("(local)" );
set oLogin = CreateObject('SQLDMO.Login');
oLogin.Name = szUserName;
oLogin.SetPassword("", szPassword);
// Login Types: 0 - SQLDMOLogin_NTUser
// 1 - SQLDMOLogin_NTGroup
// 2 - SQLDMOLogin_Standard
oLogin.Type = 2;
oSQLServer.Logins.Add(oLogin);
The following code used to create a Standard SQL account in SQL 2000. Similar code to create NT account still works. But now it is failing. I have switched to IS 2009. Is there a new way to create a SQL Server Standard account?
Code
-------
function CreateSQLUser(szServerName, szUserName, szPassword, szLoginType, bVerbose)
OBJECT oSQLServer, oLogin, oSQLRole;
begin
set oSQLServer = CreateObject('SQLDMO.SQLServer');
oSQLServer.LoginSecure = TRUE;
oSQLServer.Connect ("(local)" );
set oLogin = CreateObject('SQLDMO.Login');
oLogin.Name = szUserName;
oLogin.SetPassword("", szPassword);
// Login Types: 0 - SQLDMOLogin_NTUser
// 1 - SQLDMOLogin_NTGroup
// 2 - SQLDMOLogin_Standard
oLogin.Type = 2;
oSQLServer.Logins.Add(oLogin);
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Nov 30, 2008
12:36 AM
Why don't you create an SQL user by using SQL script?