I hope somebody can help.
I just took over an application where my predecessor encrypted a couple of fields in a basic table (e.g. Date of Birth, Phone #). I don't need those fields encrypted at this point and I want to be able to display the decrypted data, on a Grid.
I have the encryption key and can easily decrypt a single field in a single row, with "a5_decrypt_string(getDOB,"mykey")" in XBasic. I just added a Button to the rows of the Grid, which calls this function as an Ajax Callback (it works perfectly. I even added a "Grid Refresh" to the Action JavaScript, so the decrypted data appears for that row is a second or 2):
But here's my request: There are more than 1,200 clients in this table/Grid and I really don't want to have to click the Button 1,200+ times.
Is there a way to go through all of the rows in this table and add the decrypted information into the "DOB2" field? My formula is simple, because I can just use the "currentRowData". So, I think I need to be able to run the UPDATE command and then go to the "next row" and do it again, until all of the rows are decrypted.
I'd appreciate any help or suggestions. Thanks
Phil
I just took over an application where my predecessor encrypted a couple of fields in a basic table (e.g. Date of Birth, Phone #). I don't need those fields encrypted at this point and I want to be able to display the decrypted data, on a Grid.
I have the encryption key and can easily decrypt a single field in a single row, with "a5_decrypt_string(getDOB,"mykey")" in XBasic. I just added a Button to the rows of the Grid, which calls this function as an Ajax Callback (it works perfectly. I even added a "Grid Refresh" to the Action JavaScript, so the decrypted data appears for that row is a second or 2):
function decrypt as c (e as p)
Dim cn as sql::connection
Dim args as sql::arguments
Dim sqlCommand as c
dim DOBdecrypt as c
dim enc_str2 as c
dim IdNum as n
' Get the Record Number and Decrypt the "DOB" field
IdNum = e._currentRowDataOld.ID;
DOBdecrypt = e._currentRowDataOld.DOB;
enc_str2 = a5_decrypt_string(DOBdecrypt,"mykey")
args.set("NewDOB",enc_str2);
args.set("IdNum",IdNum);
'debug(1)
' Update the SQL Table record by adding the decrypted data into a field I created called DOB2
flag = cn.open("::Name::localClients")
sqlCommand = "UPDATE clients Set clients.DOB2 = :NewDOB WHERE ID=:IdNum;"
flag = cn.execute(sqlCommand, args)
cn.close()
end function
Dim cn as sql::connection
Dim args as sql::arguments
Dim sqlCommand as c
dim DOBdecrypt as c
dim enc_str2 as c
dim IdNum as n
' Get the Record Number and Decrypt the "DOB" field
IdNum = e._currentRowDataOld.ID;
DOBdecrypt = e._currentRowDataOld.DOB;
enc_str2 = a5_decrypt_string(DOBdecrypt,"mykey")
args.set("NewDOB",enc_str2);
args.set("IdNum",IdNum);
'debug(1)
' Update the SQL Table record by adding the decrypted data into a field I created called DOB2
flag = cn.open("::Name::localClients")
sqlCommand = "UPDATE clients Set clients.DOB2 = :NewDOB WHERE ID=:IdNum;"
flag = cn.execute(sqlCommand, args)
cn.close()
end function
But here's my request: There are more than 1,200 clients in this table/Grid and I really don't want to have to click the Button 1,200+ times.
Is there a way to go through all of the rows in this table and add the decrypted information into the "DOB2" field? My formula is simple, because I can just use the "currentRowData". So, I think I need to be able to run the UPDATE command and then go to the "next row" and do it again, until all of the rows are decrypted.
I'd appreciate any help or suggestions. Thanks
Phil
Comment