The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
|
|
Query regarding data grids!
Posted: 21 Sep 07 2:35 AM
|
Hi!
I need to mask the password fields in a datagrid so that the user will see "*****" instead of the original password.
I tried the following code! But Once I assignt the recordset to the datagrid, the values are getting reflected in the Database. i.e. the password field of the database contains ****** instead of the value!
Why is this happening ?
------------------------------------------------------------------------------------- SQLString = "SELECT CONF, VALUE FROM TABLEXXX" RS.Open SQLString, Conn.Connection
While RS.EOF <> True X = RS.Fields("CONF").Value If X = "SLX Password" then Password = RS.Fields("VALUE").Value If Len(Password) > 0 then For i = 0 to Len(Password) PasswordDuplicate = PasswordDuplicate & "*" Next else PasswordDuplicate = "*********" End if RS.Fields("VALUE").Value = PasswordDuplicate End if RS.MOVENEXT Wend RS.MOVEFIRST
DGConfiguration.Recordset = RS DGConfiguration.Refresh
RS.Close Set RS = Nothing Set Conn = Nothing ---------------------------------------------------------------------------------------
Though there is not any 'Update' statement in the datagrid, it is getting updated in the Database tables. Why is it so ?
TIA! CGK. |
|
|
|
Re: Query regarding data grids!
Posted: 21 Sep 07 8:39 AM
|
On your datagrid, go into the Columns properties (not the Query builder accessible via SQL). Right click on the Column that you have your password, and select properties. On the Pwd Char property, enter your Password Character ("*" asterik is a common one) Save your changes and test it, this should accomplish what you want without having to modify your data. |
|
|
|
Re: Query regarding data grids!
Posted: 25 Sep 07 3:40 AM
|
You could also use SLXRWEL object to encrypt or decrypt data, however if u want to display as asteriks characters you can use Raul's method.
Cheers Kannan |
|
|
|
Re: Query regarding data grids!
Posted: 25 Sep 07 2:06 PM
|
My question is why even show the field for a password on the grid. It seems to be a white noise feature that does not give any user value.
Mark |
|
|
|