Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Setting OLE Object Type to Null

I am using VB6-SP6 for an app with a backend of MS Access. One of the fields in the database is of data type "OLE Object". In my app, I have an Image Box that a graphic is loaded into and then it is stored in the database in the OLE Object field. When the database is viewed, if there is something in the field, Access shows it as "Long Binary Data". No problem so far.

The issue I have is when I check to see if there is anything in the field. If nothing has been put into the field, I can check to see if it is Null. But, once I put something into the field I cannot get it back to Null. This occurs when I remove the picture from the Image Box as I do that by using the command:

Set imagebox.Picture = LoadPicture ()

After I do this, the field in the database still shows "Long Binary Data". A text representation of the field just using MsgBox shows the data to be "?". Yet, I cannot check for a comparison on that as I am told there is a "Type Mismatch" no matter on how I try to convert the data.

All I really need to be able to do is to set the Picture property to Null or figure out how to check for this "?" string in the field (I know it's not really a "?", but I can't seem to figure out how to compare to a Long Binary Data type).

Thanks,
The Merg
[1319 byte] By [The Merg] at [2007-11-11 8:01:17]