Click here to Skip to main content
15,911,711 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: help in VC code Pin
Cedric Moonen16-Oct-05 22:01
Cedric Moonen16-Oct-05 22:01 
GeneralRe: help in VC code Pin
ThatsAlok16-Oct-05 22:18
ThatsAlok16-Oct-05 22:18 
GeneralRe: help in VC code Pin
Cedric Moonen17-Oct-05 3:26
Cedric Moonen17-Oct-05 3:26 
GeneralRe: help in VC code Pin
Eytukan17-Oct-05 3:53
Eytukan17-Oct-05 3:53 
AnswerRe: help in VC code Pin
ThatsAlok16-Oct-05 22:41
ThatsAlok16-Oct-05 22:41 
AnswerRe: help in VC code Pin
Iain Clarke, Warrior Programmer17-Oct-05 0:20
Iain Clarke, Warrior Programmer17-Oct-05 0:20 
Questionvc++ ado xml mssql 2000 problem - only reurns the first 2033 characters of my xml Pin
compoundeye16-Oct-05 21:41
compoundeye16-Oct-05 21:41 
Answersolved my own problem Pin
compoundeye17-Oct-05 11:26
compoundeye17-Oct-05 11:26 
it turns out that sql server isn't returning all the xml in one row of the recordset

so the answer is moveNext() then keep chunking.


hope this helps someone else one day, it was driving me crazy

I better explain the whole problem so google can find this post.


when using a recordset to read in a FOR XML EXPLICIT select from mssql server in vc++
the first recordset field does not contain the entire xml string, only a segment, the size of which must depend on the size of buffer set somewhere, i think in mssql.

the xml string is spread over n recordset rows

to get the next section you must move to the next record and so on.

the following code solve the problem
<br />
		m_pRecordset = m_pCommand->Execute(NULL, NULL, adCmdStoredProc);<br />
		<br />
		while(!m_pRecordset->EndOfFile)<br />
		{<br />
			lOffset = 0;<br />
			lTotalSize = m_pRecordset->Fields->GetItem(long(0))->ActualSize/2; // Becuase of being WChar<br />
			<br />
			//long ltest = (long)m_pRecordset->Fields->GetItem(long(0))->DefinedSize;  <br />
			//long ltype = (long)m_pRecordset->Fields->GetItem(long(0))->Type; <br />
<br />
			//lTotalSize = m_pRecordset->Fields->Item("XML_F52E2B61-18A1-11d1-B105-00805F49916B")->ActualSize/2; // Becuase of being WChar<br />
			if (lTotalSize <= 0)<br />
			{<br />
				return false;<br />
			}<br />
			<br />
			while (lOffset < lTotalSize)<br />
			{<br />
				bsChunk = m_pRecordset->Fields->GetItem(long(0))->GetChunk(lChunkSize);<br />
				//bsChunk = m_pRecordset->Fields->GetItem("XML_F52E2B61-18A1-11d1-B105-00805F49916B")->GetChunk(lChunkSize);<br />
				bsXML   = bsXML + bsChunk;<br />
				lOffset = lOffset + lChunkSize;<br />
			}<br />
			m_pRecordset->MoveNext();<br />
		}<br />
		m_sXML = (string)bsXML;<br />


mat
Questionmoving controls on a dialog dynamically Pin
caykahve16-Oct-05 21:23
caykahve16-Oct-05 21:23 
AnswerRe: moving controls on a dialog dynamically Pin
Iain Clarke, Warrior Programmer17-Oct-05 0:17
Iain Clarke, Warrior Programmer17-Oct-05 0:17 
GeneralRe: moving controls on a dialog dynamically Pin
caykahve17-Oct-05 2:12
caykahve17-Oct-05 2:12 
AnswerRe: moving controls on a dialog dynamically Pin
David Crow17-Oct-05 2:42
David Crow17-Oct-05 2:42 
GeneralRe: moving controls on a dialog dynamically Pin
Eytukan17-Oct-05 4:24
Eytukan17-Oct-05 4:24 
QuestionHow to create assembly file Pin
Ritu Kwatra16-Oct-05 21:04
Ritu Kwatra16-Oct-05 21:04 
AnswerRe: How to create assembly file Pin
ThatsAlok16-Oct-05 21:45
ThatsAlok16-Oct-05 21:45 
AnswerRe: How to create assembly file Pin
Rage16-Oct-05 23:36
professionalRage16-Oct-05 23:36 
QuestionHow to create assembly file Pin
Ritu Kwatra16-Oct-05 21:04
Ritu Kwatra16-Oct-05 21:04 
QuestionChecking Windows Version in installation Pin
Anonymous16-Oct-05 20:38
Anonymous16-Oct-05 20:38 
QuestionLine Profiling Pin
ashwath200516-Oct-05 20:31
ashwath200516-Oct-05 20:31 
QuestionInstallation for VC++ project Pin
Anonymous16-Oct-05 20:28
Anonymous16-Oct-05 20:28 
Questionhelp! why the compiler kept modifying my source file? Pin
ewighell16-Oct-05 19:29
ewighell16-Oct-05 19:29 
AnswerRe: help! why the compiler kept modifying my source file? Pin
Rage16-Oct-05 23:39
professionalRage16-Oct-05 23:39 
GeneralRe: help! why the compiler kept modifying my source file? Pin
ewighell17-Oct-05 1:00
ewighell17-Oct-05 1:00 
QuestionHow to find data encoding of received buffer with WSARecv Pin
Member 168985516-Oct-05 19:00
Member 168985516-Oct-05 19:00 
AnswerRe: How to find data encoding of received buffer with WSARecv Pin
ThatsAlok16-Oct-05 21:43
ThatsAlok16-Oct-05 21:43 

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.