Click here to Skip to main content
16,010,268 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralPlease Try help me !!! I have problem in my code in saving and reading from file . Pin
26-Jul-01 10:12
suss26-Jul-01 10:12 
GeneralPLEASE !!! HELP ME !!! IT IS VERY URGENT !!!!!!! Pin
26-Jul-01 18:39
suss26-Jul-01 18:39 
GeneralRe: PLEASE !!! HELP ME !!! IT IS VERY URGENT !!!!!!! Pin
Christian Graus26-Jul-01 19:21
protectorChristian Graus26-Jul-01 19:21 
GeneralDetails of the errors that I gets . Please, Please HELP !!!!!! Pin
26-Jul-01 21:07
suss26-Jul-01 21:07 
Generaldate picker problems Pin
26-Jul-01 9:01
suss26-Jul-01 9:01 
GeneralRe: date picker problems Pin
Derek Waters26-Jul-01 16:38
Derek Waters26-Jul-01 16:38 
GeneralRe: date picker problems Pin
27-Jul-01 2:37
suss27-Jul-01 2:37 
GeneralOLE DB and IRowsetChange::SetData Pin
Bret Faller26-Jul-01 8:16
Bret Faller26-Jul-01 8:16 
Hello,

I'm trying to write an OLE DB Wrapper class and have created a function called SetStringFieldValue and inside that function I need to set 1 columns data to the string passed to the function. I have yet to find any examples of SetData anywhere and for some reason its not working for me. Any help is greatly appreciated.

void COleDBWrapper::SetStringFieldValue(int nIndex, LPCTSTR lpszValue)
{
CString strValue(lpszValue);
IRowsetChange* pIRowsetChange = (IRowsetChange*)m_pUnkRowsetChange;
IRowsetUpdate* pIRowsetUpdate = (IRowsetUpdate*)m_pUnkRowsetUpdate;
IAccessor* pIAccessor = NULL;
HACCESSOR hAccessor;
ULONG cBindings = 1;
DBBINDING rgBinding[1];
memset(rgBinding, 0, sizeof(DBBINDING));

char szValue[50];
_tcscpy(szValue, strValue.GetBuffer(0));

rgBinding[0].iOrdinal = nIndex;
rgBinding[0].dwPart = DBPART_VALUE|DBPART_STATUS|DBPART_LENGTH;
rgBinding[0].obLength = (strValue.GetLength() + 1) * sizeof(TCHAR);
rgBinding[0].obStatus = (strValue.GetLength() + 1) * sizeof(TCHAR);
(CString)rgBinding[0].obValue = szValue; // -- DOESN'T DO JACK! -- //
rgBinding[0].wType = DBTYPE_STR;
rgBinding[0].pTypeInfo = NULL;
rgBinding[0].pObject = NULL;
rgBinding[0].pBindExt = NULL;
rgBinding[0].dwMemOwner = DBMEMOWNER_CLIENTOWNED;
rgBinding[0].cbMaxLen = (strValue.GetLength() + 1) * sizeof(TCHAR);
rgBinding[0].dwFlags = 0;

HRESULT hr = m_pUnkRowset->QueryInterface(IID_IAccessor, (void**)&pIAccessor);
if (FAILED(hr))
return;

hr = pIAccessor->CreateAccessor(DBACCESSOR_ROWDATA, 1, rgBinding, 0,
&hAccessor, NULL);
if (FAILED(hr))
return;

hr = pIRowsetChange->SetData(m_hRow, hAccessor, szValue);
// hr is ALWAYS DB_E_ERRORSOCCURRED
}


Bret Faller
Odyssey Computing, Inc.
GeneralRe: OLE DB and IRowsetChange::SetData Pin
Tomasz Sowinski26-Jul-01 8:41
Tomasz Sowinski26-Jul-01 8:41 
GeneralRe: OLE DB and IRowsetChange::SetData Pin
Bret Faller26-Jul-01 11:44
Bret Faller26-Jul-01 11:44 
QuestionAt run time, how do I draw a box around few edit controls? Pin
tm26-Jul-01 6:58
tm26-Jul-01 6:58 
AnswerRe: At run time, how do I draw a box around few edit controls? Pin
Tomasz Sowinski26-Jul-01 7:15
Tomasz Sowinski26-Jul-01 7:15 
GeneralResizing of a dialog box Pin
26-Jul-01 6:27
suss26-Jul-01 6:27 
GeneralRe: Resizing of a dialog box Pin
Carlos Antollini26-Jul-01 6:36
Carlos Antollini26-Jul-01 6:36 
GeneralRe: Resizing of a dialog box Pin
27-Jul-01 1:39
suss27-Jul-01 1:39 
GeneralRe: Resizing of a dialog box Pin
Christian Graus27-Jul-01 2:18
protectorChristian Graus27-Jul-01 2:18 
GeneralRe: Resizing of a dialog box Pin
26-Jul-01 7:17
suss26-Jul-01 7:17 
GeneralRe: Resizing of a dialog box Pin
Ernest Laurentin27-Jul-01 9:43
Ernest Laurentin27-Jul-01 9:43 
GeneralRe: Resizing of a dialog box Pin
31-Jul-01 1:18
suss31-Jul-01 1:18 
GeneralPersisting Bitmaps Pin
Ganesh Ramaswamy26-Jul-01 6:18
Ganesh Ramaswamy26-Jul-01 6:18 
GeneralRe: Persisting Bitmaps - forget it Pin
Ganesh Ramaswamy26-Jul-01 10:20
Ganesh Ramaswamy26-Jul-01 10:20 
QuestionCListCtrl missing GetSelItems(). Any Reason?? Pin
Chris Meech26-Jul-01 6:17
Chris Meech26-Jul-01 6:17 
AnswerRe: CListCtrl missing GetSelItems(). Any Reason?? Pin
Tomasz Sowinski26-Jul-01 6:51
Tomasz Sowinski26-Jul-01 6:51 
GeneralRe: CListCtrl missing GetSelItems(). Any Reason?? Pin
Chris Meech26-Jul-01 7:36
Chris Meech26-Jul-01 7:36 
QuestionCListCtrl missing GetSelItems(). Any Reason?? Pin
Chris Meech26-Jul-01 6:17
Chris Meech26-Jul-01 6:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.