lpassword for numeric get

lpassword for numeric get

Postby fraxzi » Wed Sep 22, 2010 2:01 am

Dear All,

I need to set password to hide data..

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

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
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: lpassword for numeric get

Postby nageswaragunupudi » Wed Sep 22, 2010 2: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
User avatar
nageswaragunupudi
 
Posts: 10628
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: lpassword for numeric get

Postby fraxzi » Wed Sep 22, 2010 2: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
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: lpassword for numeric get

Postby fraxzi » Wed Sep 22, 2010 2: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
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: lpassword for numeric get

Postby James Bott » Wed Sep 22, 2010 4:38 pm

Fraxzi,

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

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: lpassword for numeric get

Postby fraxzi » 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
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: lpassword for numeric get

Postby James Bott » 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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: lpassword for numeric get

Postby fraxzi » Thu Sep 23, 2010 1: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
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: lpassword for numeric get

Postby nageswaragunupudi » Thu Sep 23, 2010 1: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
User avatar
nageswaragunupudi
 
Posts: 10628
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: lpassword for numeric get

Postby James Bott » Thu Sep 23, 2010 1: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: lpassword for numeric get

Postby fraxzi » Thu Sep 23, 2010 2:55 am

Mr. RAO,

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

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
Last edited by fraxzi on Thu Sep 23, 2010 3:01 am, edited 1 time in total.
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
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: lpassword for numeric get

Postby fraxzi » Thu Sep 23, 2010 3: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
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 66 guests