I am havin a problem in loading and storing a CLongBinary data from and to a database.
I am using MS access database and I am trying to store a binary form of Cstring data in to the database field which is of type oleobject.
This is the part of my code where i am trying to store.
Please help me out this code :

trial_obj.Open(); // MFC Wizard class created in vc++
pVoid = NULL;
len = str.GetLength()+1;
trial_obj.m_data2.m_hData = ::GlobalAlloc(GPTR,len); // trial_obj.m_data2 is a oleobject field in database
pVoid = ::GlobalLock(trial_obj.m_data2.m_hData);
trial_obj.m_data2.m_dwDataLength =::GlobalSize(trial_obj.m_data2.m_hData);