I have an Encrypted Sql table with a field called "EmployeeName .. Select * From Rates order on EMployeeName .....
That is fairly straight forward, but the Field "EmployeeName" is Encrypted .. To Unencrypt the EMployeeName Column I use the old Trick Add oCol ( see below ) and Have a user defined function that Dencrypts the EmployeeName field .. so when a user call the program .. all they see is the un-encrypted EMployeeName.. ( great )
However, when the table was opened it was ordered with the encrypted EmployeeName values ... which once xBrowse is created now has the un-encrypted EMployeeName out of senquence with the encrypted table value ..
Is there a way to re-sort the EMployeeNAme column on its dencrypted value ?.. after xprowse has been painted with the encrypted value ? .. The Sort:EmployeeName ( now de-encrypted) does nothing ...
Any Ideas ?
Thanks
Rick Lipkin
- Code: Select all Expand view RUN
cSql := "Select * From [Rates] "
cSql += "Order by [EmployeeName]"
TRY
oRsRate:Open( cSQL,xCONNECT )
CATCH oErr
MsgInfo( "Error in Opening RATES table" )
RETURN(.F.)
END TRY
.....
.....
REDEFINE xBROWSE oLBX ;
RECORDSET oRsRate ;
COLUMNS "EFFECTIVEDATE", ;
"EMPLOYEERATE", ;
"ACTIVE" ;
COLSIZES 80,80,65 ;
HEADERS "Effective Dt", ;
"Rate", ;
"Active" ;
ID 111 of oDlg ;
AUTOSORT AUTOCOLS LINES CELL
oLbx:nMarqueeStyle := MARQSTYLE_HIGHLROW
oLbx:lRecordSelector := .f.
oLbx:lHScroll := .f. // turn off horiz scroll bar
ADD oCol to oLbx AT 1 DATA {|x| x := _ChkUser(oRsRate:Fields("EmployeeName"):Value) } HEADER "Employee Name" size 200 ;
Sort:EmployeeName
//--------------------------------
Static Func _ChkUser( cEmployeeName )
Local cName
cEmployeeName := alltrim(dencrypt(cEmployeeName ))
cName := substr( cEmployeeName+space(36),1,36)
Return( cName )