>Hi,
>
>How would you use Symmetric Key Encryption with CursorAdapter? (if it is possible). I have created a sample database with a table and the symmetric key (in SSMS). So in the SSMS I can use ENCRYPTBYKEY and KEY_GUID to add a record. For example:
>
>Insert into test (column1) values (ENCRYPTBYKEY(KEY_GUID('TestKey'),'New Value'))
>
>
>But if you update the table (from VFP) using Cursor Adapter, would you write the code like above in VFP and the CA would work? And since functions ENCRYPTBYKEY and KEY_GUID are not available to VFP compiler, the code won't even compile. I searched UT (for a few years back) and no mention of key word 'ENCRYPTBYKEY'. Does it mean that Symmetric Key Encryption is not used with VFP applications? TIA for any input.
You could set UpdateCmd and InsertCmd to match your request:
CA.UpdateCmd = "UPDATE Table SET Column1 = ENCRYPTBYKEY(KEY_GUID('TestKey'),?Alias.Field) WHERE KeyField = ?Alias.KeyField"
CA.InsertCmd = "Insert into Table (column1) values (ENCRYPTBYKEY(KEY_GUID('TestKey'),?Alias.Field))"
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.