Click here to Skip to main content
15,891,033 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralActive movie ACTIVEX Pin
Ghasrfakhri4-May-01 7:15
Ghasrfakhri4-May-01 7:15 
GeneralSpecial Folders Pin
4-May-01 5:23
suss4-May-01 5:23 
GeneralpDevMode member of JOB_INFO_2 is empty in 98 Pin
4-May-01 5:02
suss4-May-01 5:02 
Questionconvert existing C++ program to MFC? Pin
4-May-01 2:42
suss4-May-01 2:42 
AnswerRe: convert existing C++ program to MFC? Pin
Garth J Lancaster4-May-01 16:24
professionalGarth J Lancaster4-May-01 16:24 
GeneralExtending a dialog on button press! Pin
Ashman3-May-01 23:09
Ashman3-May-01 23:09 
GeneralRe: Extending a dialog on button press! Pin
Christian Graus3-May-01 23:40
protectorChristian Graus3-May-01 23:40 
QuestionArray of bound ADO objects? Pin
Brendan Tregear3-May-01 19:47
Brendan Tregear3-May-01 19:47 
Hi,

Once again I'm banging my head against this ADO stuff. Here's my prob:

I have an array of pointers to CADORecordBinding objects. I want to associate each object in the array with a record from the database.

Problem is If i call pBndRs->BindToRecordset(pVisitRs) for each new object, I get a com_error. I've also tried increasing the reference count for pVisitRs but this fails too.

<br />
  	  IADORecordBinding * pBndRs;<br />
	  CVisitBndRs * pVisitBndRs;<br />
          _RecordsetPtr pVisitRs;<br />
<br />
	  TESTHR(pVisitRs->QueryInterface(__uuidof(IADORecordBinding), (LPVOID*) &pBndRs)); //Get the interface pointer<br />
<br />
	  while (!pVisitRs->GetadoEOF())<br />
	  {<br />
		pVisitBndRs = new CVisitBndRs();   //Make a new CADORecordBindingObject<br />
		m_visitBndArray.Add(pVisitBndRs);  //Add its pointer to the array	<br />
	        TESTHR(pBndRs->BindToRecordset(pVisitBndRs)); //This bombs on 2nd time round<br />
		pVisitRs->MoveNext(); //Move to next record. This *should* update all the C++ variables in our new pVisitBndRs object<br />
	  }<br />


So I end up with the first object in the array getting the values of the most recent record, and all the rest contain junk.

Any help greately appreciated..

But for now my brain must rest for the weekend Smile | :)

Regards

Brendan
AnswerRe: Array of bound ADO objects? Pin
Brendan Tregear6-May-01 12:18
Brendan Tregear6-May-01 12:18 
AnswerRe: Array of bound ADO objects? Pin
Hadi Rezaee7-May-01 3:11
Hadi Rezaee7-May-01 3:11 
GeneralForcing the system tray clock to redraw Pin
Peter Jones3-May-01 18:40
Peter Jones3-May-01 18:40 
GeneralRe: Forcing the system tray clock to redraw Pin
Peter Jones3-May-01 20:45
Peter Jones3-May-01 20:45 
Generaldisableing ur key board Pin
Anil3-May-01 18:32
Anil3-May-01 18:32 
GeneralRe: disableing ur key board Pin
Christian Graus3-May-01 19:58
protectorChristian Graus3-May-01 19:58 
Generalis this possible Pin
Anil4-May-01 2:16
Anil4-May-01 2:16 
GeneralRe: is this possible Pin
Christian Graus4-May-01 2:28
protectorChristian Graus4-May-01 2:28 
Generalwon't display to screen Pin
3-May-01 17:44
suss3-May-01 17:44 
GeneralRe: won't display to screen Pin
Masaaki Onishi3-May-01 18:01
Masaaki Onishi3-May-01 18:01 
GeneralRe: won't display to screen Pin
Christian Graus3-May-01 20:23
protectorChristian Graus3-May-01 20:23 
GeneralCListCtrl and selected rows in a dialog Pin
Peter Jones3-May-01 14:54
Peter Jones3-May-01 14:54 
GeneralRe: CListCtrl and selected rows in a dialog Pin
Nick Blumhardt3-May-01 16:53
Nick Blumhardt3-May-01 16:53 
GeneralRe: CListCtrl and selected rows in a dialog Pin
Peter Jones3-May-01 18:37
Peter Jones3-May-01 18:37 
GeneralRe: CListCtrl and selected rows in a dialog Pin
Tomasz Sowinski3-May-01 23:54
Tomasz Sowinski3-May-01 23:54 
GeneralRe: CListCtrl and selected rows in a dialog Pin
Peter Jones4-May-01 3:18
Peter Jones4-May-01 3:18 
GeneralDB_NUMERIC Pin
Nick Blumhardt3-May-01 14:19
Nick Blumhardt3-May-01 14:19 

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.