SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 login creation
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

krthk86.g
Starting Member

India
2 Posts

Posted - 01/09/2012 :  22:47:04  Show Profile  Reply with Quote
hi all, i am developing the timesheet program for my Team, currently using Javascript, i was able to INSERT, UPDATE, DELETE, UPDATE using javascript. but unable to create login & change password. can anyone give me solution.

the following code was used for basic function

var ConProv = new ActiveXObject("ADODB.Connection");
var ConnString ="Driver={SQL Server};Server=IESCHN047WSN;Database=employee;UID=sa;PWD=mysql@123";
ConProv.Open(ConnString);
var RecSet = new ActiveXObject("ADODB.Recordset");



Thanks in Advance.

G.Karthikeyan

X002548
Not Just a Number

15586 Posts

Posted - 01/10/2012 :  13:45:25  Show Profile  Reply with Quote
Sure

Contact the dba

And then start writing stored procedures



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

krthk86.g
Starting Member

India
2 Posts

Posted - 01/10/2012 :  14:59:44  Show Profile  Reply with Quote
may i know the stored procedure....?

and i am unable retrieve the date in dd-mm-yyyy format, how can i change that. i lknow about convert(varchar(10), getdate(), 105) but where to place in javascript...?

G.Karthikeyan
Go to Top of Page

biswajitdas
Starting Member

USA
44 Posts

Posted - 01/11/2012 :  16:07:46  Show Profile  Reply with Quote
I can understand your scenario. You want to control the creation of users from the front end (application end) without interfering SQL server time time.

Please use SQLDMO object for this. SQLDMO gives you all the properties to play around with all the admin function which can be done from the coding.


Let me know if you required the coding part, as I know you can explore the programming part.



Example:-

#region create a login object and populate it
SQLDMO.Login login = new SQLDMO.Login();
string loginName = strDatabaseName + "_WebLogin";
login.Name = loginName;
string password = "password";

login.SetPassword("", password);
login.Database = strDatabaseName;


Sr Sql server DBA/Artitech
Go to Top of Page

Sachin.Nand
Flowing Fount of Yak Knowledge

2937 Posts

Posted - 01/11/2012 :  23:00:25  Show Profile  Reply with Quote
Oh God..Now this is a BAD BAD VERY VERY BAD design...

First writing a javascript code to connect to server.It would mean that a user can just right click the web page and click view source and know the server and the username to which the application is connecting to.

Second you want to create database users through an application which is really terrible.

Also please dont tell me that the username in the connection string is of the role sysadmin and it does looks like that since you are using sa.

If somethings are allowed in SQL Server it DOES NOT mean you should use it without giving a second thought.

After Monday and Tuesday even the calendar says W T F ....
Go to Top of Page

biswajitdas
Starting Member

USA
44 Posts

Posted - 01/12/2012 :  16:50:13  Show Profile  Reply with Quote
@krthk86.g - Can I ask you one question,I am not worried about your script , as I understand that you want to create an login or user from application , If so then use sqldmo.Having said that who can create a login and who canot not etc its your progrsming security level and review of SOX compliance.I think you want how you can create login the answer is SQLDMO or ENUM.

-------------------------------------------------

@Sachin.Nand- If you think create database user or an application login is terrible design as you mentioned above, Can I ask you very simple question is that "How you cerate your user id in FACEBOOK , YAHOO ,GMAIL , ORKUT , also in this SQL FORUM ?Do you think there is a DBA create your login for you in the database or you do your self in the front end ?










Sr Sql server DBA/Artitech

Edited by - biswajitdas on 01/12/2012 17:01:56
Go to Top of Page

Sachin.Nand
Flowing Fount of Yak Knowledge

2937 Posts

Posted - 01/13/2012 :  03:03:43  Show Profile  Reply with Quote
quote:
@Sachin.Nand- If you think create database user or an application login is terrible design as you mentioned above, Can I ask you very simple question is that "How you cerate your user id in FACEBOOK , YAHOO ,GMAIL , ORKUT , also in this SQL FORUM ?Do you think there is a DBA create your login for you in the database or you do your self in the front end ?


Do you understand a difference between a database user and an application user ?

Also where did I mention that creating an application user from a front end is a terrible design ?



After Monday and Tuesday even the calendar says W T F ....
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.11 seconds. Powered By: Snitz Forums 2000