I want to read from and write to a binary column 'Password' with an ActiveX-scripted DTS task.
It works fine as long as I don't manipulate the data.

Example that works:

buffer = DTSSource("Password")
DTSDestination("Password") = buffer

But when I start doing something meaningful, I always run into

"ActiveX Scripting Transform 'DTSTransformation__5' encountered an invalid data value for 'Password' destination column."

Example that doesn't work:

source = DTSSource("Password")
dest = ""
For i = 1 To Len(source)
dest = dest + Mid(source, i, 1)
DTSDestination("Password") = dest

Perhaps somehow it has to do with the "dest" variable in the second example containing a string, but I can't find a way to solve this problem. (Well, maybe copying to a third table and using Transact-SQL to convert the string to binary.)