For anyone who may be interested in the resolution to this problem:

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. And that seems to have been the reason for the error message.

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