Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Functions
Message
 
 
À
09/12/2009 10:32:25
Brad Clark
Delta Express Systems, Inc.
Georgie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01438204
Message ID:
01438211
Vues:
64
>I want to replace a field within a table. Basically it is a little encrypt/decrypt function that I have written. Now I want to be able to apply it to a particular field within a table for security reasons.
function UpdateField

local loError, llReturn

llReturn = .t.

try
   use myTable in 0 alias ToEncrypt exclusive && Do we really need to use table exclusive?
catch to loError
   llReturn = .f.
endtry

if m.llReturn
   try

       replace all myField with Encrypt(myField) in ToEncrypt
   catch to loError
      llReturn = .f. && At this point some of fields could be encrypted, some not - perhaps it's better to buffer the table and do tableupdate instead
   endtry
endif

return m.llReturn
Here is a quick sample - you may implement better error handling and also handle this using table in buffered mode...
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform