Running sp_password from asp

Results 1 to 3 of 3

Thread: Running sp_password from asp

  1. #1
    Graeme Webster Guest

    Default Running sp_password from asp

    Is it possible to run the sql server stored procedure sp_password from asp?<BR>I seem to be having trouble passing the parameters and wonder if I am attempting the impossible.<BR>Thanks in advance

  2. #2
    Join Date
    Dec 1969

    Default RE: Running sp_password from asp

    Graeme, <BR><BR>Are you using &#039ADODB.Command&#039 , Command object for executing the Stored procedure?<BR>If so ,and still you rae getting errors, please write,<BR>Good luck,

  3. #3
    Garth Guest

    Default RE: Running sp_password from asp

    The code shown below works.<BR><BR>Garth<BR><BR><BR><BR> REM Code Starts Here<BR>&#060;!--#include file=""--&#062;<BR>&#060;%<BR> Login = "garth"<BR> OldPassword = "test"<BR> NewPassword = "changepass"<BR><BR> Set objConn = server.CreateObject("ADODB.Connection")<BR> REM DSN-Less OLE-DB<BR> objConn.Open "Provider=SQLOLEDB;Server=ACE;Database=Northwind;U id=sa;Pwd="<BR><BR> Set cmd1 = server.CreateObject("ADODB.Command")<BR> cmd1.ActiveConnection = objConn<BR> cmd1.CommandType = adCmdStoredProc<BR> cmd1.CommandText = "sp_password"<BR> cmd1.Parameters.Append cmd1.CreateParameter("new",adVarChar,adParamInput, 128,OldPassword)<BR> cmd1.Parameters.Append cmd1.CreateParameter("loginame",adVarChar,adParamI nput,128,NewPassword)<BR> cmd1.Parameters.Append cmd1.CreateParameter("old",adVarChar,adParamInput, 128,Login)<BR><BR> cmd1.Execute<BR><BR> objConn.Close<BR>%&#062;<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts