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.
Author |
Topic |
krthk86.g
Starting Member
2 Posts |
Posted - 2012-01-09 : 22:47:04
|
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 functionvar 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 |
|
krthk86.g
Starting Member
2 Posts |
Posted - 2012-01-10 : 14:59:44
|
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 |
|
|
biswajitdas
Starting Member
44 Posts |
Posted - 2012-01-11 : 16:07:46
|
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 |
|
|
Sachin.Nand
2937 Posts |
Posted - 2012-01-11 : 23:00:25
|
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 .... |
|
|
biswajitdas
Starting Member
44 Posts |
Posted - 2012-01-12 : 16:50:13
|
@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 |
|
|
Sachin.Nand
2937 Posts |
Posted - 2012-01-13 : 03:03:43
|
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 .... |
|
|
|
|
|
|
|