You can make it more or less complicated.
The easiest (but pretty worthless safety-wise) approach is, as you suggested, to have each character correspond to a different character / value and the just replace all characters in the source string to conform to that. Of course every one character should be represented by one unique number so that it cannot get mixed up.
The easiest way to carry out this in DBPro would be to have a constant array set up that maps the characters to other values based on their ASCII codes (the
asc() function will come in handy to get the ascii value from a single character, that can be retrieved from a string using the
mid$() function). The mapping must be consistent so that if, say the letter "K" previously corresponded to the value '99', it must do so in all future (as well as previous) runs, or you'll get into trouble when you want to decrypt the string. Which in this case is obviously done by carrying out the reverse operation of replacing the numbers with their corresponding characters again.
To achieve more complicated encryption, you could do a number of things, such as having a
key (like a password) that is in one way or another combined with the source string to produce the encrypted string and therefore is also required to decrypt it again. You can also borrow elements from compression, such as variable-bit mappings of the characters, etc.
"Why do programmers get Halloween and Christmas mixed up?" Because Oct(31) = Dec(25)