FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour lpassword for numeric get
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
lpassword for numeric get
Posted: Wed Sep 22, 2010 02:01 AM

Dear All,

I need to set password to hide data..

with oGet:lPassword := .T. //char type works OK [u:cg9em8ml]but in numeric type it's not.[/u:cg9em8ml]

How to do in in numeric get?

Regards,
Frances

Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: lpassword for numeric get
Posted: Wed Sep 22, 2010 02:06 AM

You need to convert the numeric value as character string and GET and take its VAL() after the get.

Regards



G. N. Rao.

Hyderabad, India
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: lpassword for numeric get
Posted: Wed Sep 22, 2010 02:20 AM
Dear Mr. RAO,

not ideal for so many get object (numeric type).. If I changed the Style via RC the get object is forever as password I cant change on the fly to go back to normal get..

in m,y app, some user must not see confidential data so need to hide it as password get..

maybe to change text/background as one color and disable it...


setting oGet:lPassword to .T./.F. is handy..


Regards,
Frances

nageswaragunupudi wrote:You need to convert the numeric value as character string and GET and take its VAL() after the get.
Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: lpassword for numeric get
Posted: Wed Sep 22, 2010 02:46 AM

Dear RAO,

It's much better this way..

if data hidden from certain user

  • oGet:oGet:Picture := "XXXXXXX.XX"
  • oGet:Disable()

else

-oGet:oGet:Picture := oGet:cPicture
- oGet:Enable()

endif

Regards,
Fraxzi

Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: lpassword for numeric get
Posted: Wed Sep 22, 2010 04:38 PM

Fraxzi,

I'm not clear. What does the picture "XXXXXXX.XX" do to the display?

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: lpassword for numeric get
Posted: Thu Sep 23, 2010 12:23 AM

Dear James,

The picture 'XXXXXXX.XX" on the numeric get will replace the display value to "XXXXXXX.XX" instead of "9999999.99" or say a value of 12,999.45
This is a workaround since oGet:lPassword := .T. works only for char type.

This is selective scenario wherein some user must not see that field value. If I change the style from resource to 'password' then it will show '*.' and selective
display will not be applicable.

Character '*' has special meaning to picture so I used 'X'.

Regards,
Frances

Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: lpassword for numeric get
Posted: Thu Sep 23, 2010 12:44 AM

Francis,

Thanks for the clarification.

If you are using a database object you could modify the Load() method to blank out any fields that were not authorized for the current users security. The advantage to this is that the database object could be used anywhere without the restricted data showing (e.g. dialogs, browses, reports, etc.) and without any changes to the coding for the dialogs, browses or reports.

Of course, if you are not already using a database object this will require code changes.

Regards,
James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: lpassword for numeric get
Posted: Thu Sep 23, 2010 01:43 AM

Dear Mr. James,

Thank you for the added info. I appreciate it.

I will look into database object.. my alias are from SQL 'select' I will try it with database object.
Right now, I am using variable to manipulate fields from SQL Alias.

I will compare.

Regards,
Frances

Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: lpassword for numeric get
Posted: Thu Sep 23, 2010 01:46 AM
The picture 'XXXXXXX.XX" on the numeric get will replace the display value to "XXXXXXX.XX" instead of "9999999.99" or say a value of 12,999.45

Nice idea :-)
Regards



G. N. Rao.

Hyderabad, India
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: lpassword for numeric get
Posted: Thu Sep 23, 2010 01:50 AM

Francis,

Are you using recordsets or a SQL database driver? If recordsets, then I am not sure you can do what I suggested.

Hmm. With a recordset you might be able to create a record class that would read from the recordset and filter out the secure fields. This would work with a dialog, but it would really slow down a browse or report since you would have to create a record object for each record in the recordset.

I would have to think about this more...

Regards,
James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: lpassword for numeric get
Posted: Thu Sep 23, 2010 02:55 AM
Mr. RAO,

Thanks.. sometimes, things are discovered accidentally when most needed.. :-)

nageswaragunupudi wrote:
The picture 'XXXXXXX.XX" on the numeric get will replace the display value to "XXXXXXX.XX" instead of "9999999.99" or say a value of 12,999.45

Nice idea :-)


Regards,
Frances
Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: lpassword for numeric get
Posted: Thu Sep 23, 2010 03:00 AM
James Bott wrote:Francis,

Are you using recordsets or a SQL database driver? If recordsets, then I am not sure you can do what I suggested.

Hmm. With a recordset you might be able to create a record class that would read from the recordset and filter out the secure fields. This would work with a dialog, but it would really slow down a browse or report since you would have to create a record object for each record in the recordset.

I would have to think about this more...

Regards,
James



Dear Mr. James,

It is recordsets from ADS. the way I look at it (in my situation), it is less work using the existing method (variable).. perhaps if I have more spare time to try database object.


Regards,
Frances
Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15

Continue the discussion