For anyone who may be interested:

The original issue for me was to get an encrypted BYTE* array of binary values stored into a SQL Server database.

I chose BSTR as the vehicle but that seems to have been incorrect.

I received from invaluable help from Krzemo in the CodeGuru Database forum.

I was told that although BSTR can contain binary values, it cannot be used to store binary values into a database.

I was advised to convert my BYTE* array to SAFEARRAY and use the SAFEARRAY to write to/read from the database.

To convert to/from BYTE* and SAFEARRAY, I adapted code from the sample in

http://www.codeproject.com/database/...select=1608797


All seems to be well.

jim