ChangePassword Pause


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: ChangePassword Pause

  1. #1
    sheryl kemp Guest

    ChangePassword Pause


    I am using the following stored proc to get the user to change his/her password
    if password='NEWPASS', I keep getting a syntax error near the word end on
    the last line.. what am I doing wrong

    ALTER PROCEDURE TESTLOGON

    @EmployeeFirstName varchar(25),
    @EmployeeLastName varchar(25),
    @EmployeePWD varchar(32),
    @msg varchar(255)
    As
    if exists(Select * From tblEmployee
    Where EmployeeFirstName = @EmployeeFirstName
    And EmployeeLastName= @EmployeeLastName
    And EmployeePWD = @EmployeePWD
    And EmployeePWD not like 'NEWPASS'
    And EmpWebAcctEnabled = 1)
    begin
    return(0)
    end
    else
    begin
    SET @msg = 'Please enter new passwordpasswords should be at least 6 characters
    long)'
    PRINT @msg
    IF NOT EXISTS (Select * From tblEmployee
    Where EmployeeFirstName = @EmployeeFirstName
    And EmployeeLastName= @EmployeeLastName
    And EmployeePWD = @EmployeePWD
    And EmployeePWD not like 'NEWPASS'
    And EmpWebAcctEnabled = 1)
    BEGIN
    UPDATE tblemployee
    Set EmployeePWD=@EmployeePWD
    Where EmployeeFirstName = @EmployeeFirstName
    And EmployeeLastName= @EmployeeLastName





  2. #2
    David Satz Guest

    Re: ChangePassword Pause

    AFAIK - there is no END to match the BEGIN at the end
    "sheryl kemp" <dianedinero@aol.com> wrote in message
    news:3c6bf77f$1@10.1.10.29...
    >
    > I am using the following stored proc to get the user to change his/her

    password
    > if password='NEWPASS', I keep getting a syntax error near the word end on
    > the last line.. what am I doing wrong
    >
    > ALTER PROCEDURE TESTLOGON
    >
    > @EmployeeFirstName varchar(25),
    > @EmployeeLastName varchar(25),
    > @EmployeePWD varchar(32),
    > @msg varchar(255)
    > As
    > if exists(Select * From tblEmployee
    > Where EmployeeFirstName = @EmployeeFirstName
    > And EmployeeLastName= @EmployeeLastName
    > And EmployeePWD = @EmployeePWD
    > And EmployeePWD not like 'NEWPASS'
    > And EmpWebAcctEnabled = 1)
    > begin
    > return(0)
    > end
    > else
    > begin
    > SET @msg = 'Please enter new passwordpasswords should be at least 6

    characters
    > long)'
    > PRINT @msg
    > IF NOT EXISTS (Select * From tblEmployee
    > Where EmployeeFirstName = @EmployeeFirstName
    > And EmployeeLastName= @EmployeeLastName
    > And EmployeePWD = @EmployeePWD
    > And EmployeePWD not like 'NEWPASS'
    > And EmpWebAcctEnabled = 1)
    > BEGIN
    > UPDATE tblemployee
    > Set EmployeePWD=@EmployeePWD
    > Where EmployeeFirstName = @EmployeeFirstName
    > And EmployeeLastName= @EmployeeLastName
    >
    >
    >
    >




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center