Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
Thread Tools Search this Thread Rate Thread
Old 30-Jan-2009, 04:55
Priya87 Priya87 is offline
New Member
Join Date: Jan 2009
Posts: 1
Priya87 is on a distinguished road

Loading and storing a CLongBinary data


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 :

CPP / C++ / C 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);


Last edited by LuciWiz : 30-Jan-2009 at 08:20. Reason: Please insert your C++ code between [cpp] & [/cpp] tags

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Network Sites: GIDNetwork · GIDApp · GIDBlog · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 15:51.

vBulletin, Copyright © 2000 - 2018, Jelsoft Enterprises Ltd.