>>>I've written a couple of routines for my customer to encrypt several fields in a table, so that the data can't be copied & taken off site
>>>
>>>I've used the "_cryptapi" class, (customers preference)
>>>
>>>Using the class if I encrypt a string, decrypting it gives me my original string, but when I put the encrypted string into the original field that the string is from in the table, when I read it back later and decrypt it I sometimes get the right results, sometimes I don't.
>>>
>>>TAI
>>
>>This is because of the spaces. You may want to add some extra characters (say, char(0)) to the end of the string so it's always padded to the right length.
>
>
>How about VARCHAR()?
May be, but I'm not sure. Also usually you store data in the character fields if we're talking about VFP, I don't think varchar in VFP is used widely.
If it's not broken, fix it until it is.
My Blog