Feedback
Did this article resolve your question/issue?

   

Article

4GL/ABL: How to change a database user's password?

Information

 
Title4GL/ABL: How to change a database user's password?
URL NameP21978
Article Number000140773
EnvironmentProduct: Progress
Version: 8.x, 9.x
Product: OpenEdge
Version: 10.x
OS: All supported platforms
Other: Passwords, ABL, RDBMS
Question/Problem Description
4GL/ABL: How to change a database user's password?
Who can change a user's password using 4GL?
How to programmatically change your user's password using 4GL/ABL?
How to programmatically change another user's password using 4GL/ABL?
Steps to Reproduce
Clarifying Information
Error Message
Defect/Enhancement Number
Cause
Resolution

Users can ONLY change their own userid and password.  For example, user 'jack' can change his password by executing the following code:

FIND FIRST _User WHERE _User._UserId = "jack" EXCLUSIVE-LOCK NO-ERROR.
IF AVAILABLE (_User) THEN
     ASSIGN _User._password = ENCODE("jill").
ELSE
     MESSAGE "This Userid does not exist"
          VIEW-AS ALERT-BOX INFO BUTTONS OK.

Attempting to change the password of another user will result in error 711:

** You can only change your own password. (711)

 

  • The Progress/OpenEdge database does not allow users (regardless of their permission level) to change another user's password in the _user table.  The only time this can be done is when creating a new user. 
  • Database Administrators may change a user's _Userid, _User-Name or _Password only by DELETING and RECREATING that user's record in the _User table programmatically or using the Database Administration tool. 
  • Security Administrators and users with CREATE/DELETE/WRITE permissions to the _User table can change another user's password by DELETING and RECREATING that user's underlying record in the _User table using the Database Administration tool or running 4GL/ABL code similar to the following:
DEFINE VARIABLE cNewPassword AS CHARACTER NO-UNDO INITIAL 'jill'.
DEFINE TEMP-TABLE tempUser NO-UNDO LIKE _User.

FIND FIRST _User WHERE _User._UserId = "jack" EXCLUSIVE-LOCK NO-ERROR.
IF AVAILABLE (_User) THEN DO:
     BUFFER-COPY _User EXCEPT _User._Password TO tempUser ASSIGN tempUser._Password = encode(cNewPassword).
     DELETE _User.
     CREATE _User.
     BUFFER-COPY tempUser EXCEPT _TenantId TO _User.
END.
ELSE
     MESSAGE "This Userid does not exist"
          VIEW-AS ALERT-BOX INFO BUTTONS OK.

Note:
This operation cannot be performed against multi-tenant databases where _User._TenantId has a value other than zero (0). The BUFFER-COPY statement will fail unless _User._TenantId is omitted.
See article# 000037498, Error (16011) when updating _User table with BUFFER-COPY for more detail.
Workaround
Notes
Last Modified Date8/8/2019 2:56 PM
Attachment 
Files
Disclaimer The origins of the information on this site may be internal or external to Progress Software Corporation (“Progress”). Progress Software Corporation makes all reasonable efforts to verify this information. However, the information provided is for your information only. Progress Software Corporation makes no explicit or implied claims to the validity of this information.

Any sample code provided on this site is not supported under any Progress support program or service. The sample code is provided on an "AS IS" basis. Progress makes no warranties, express or implied, and disclaims all implied warranties including, without limitation, the implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample code is borne by the user. In no event shall Progress, its employees, or anyone else involved in the creation, production, or delivery of the code be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample code, even if Progress has been advised of the possibility of such damages.