Need some help with size of _variant_t and Getcollect

Hello,
I try to get some data from my SQL Server.
Everything runs just fine.
The column Remarks is very large (size nvarchar 4000)
I don´t get all of the data with m_ptrRs->GetCollect("Remarks);
It looks like the Holder_Remarks is to small.
How can I fix this.
Please help.

Thank you.
Best regards,
Thomas



_variant_t Holder_Remarks;
   Cstring str_Remarks;
 
 
 
     m_ptrRs->MoveFirst();
       
    while(!m_ptrRs->EndOfFile)
    {
       Holder_Remarks                = m_ptrRs->GetCollect("Remarks);
 
 
 
            //----------- Copy _variant_t into CString ----------Bemerkung
                  if(Holder_Remarks.vt!=VT_NULL)
			{
				 str_Remarks =(LPCSTR)(_bstr_t)  
                         Holder_Remarks.bstrVal;
				 str_Remarks.TrimRight();
			}
			else
			{
				str_Remarks.Empty();
	    	      }
			str_Remarks.Replace("\r\n",", ");

Open in new window

Thomas StockbrueggerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

alb66Commented:
May be you have a '\0' in your data?
0
alb66Commented:
What happen if you use

str_Remarks = CString( m_ptrRs->Fields->Item[xx]->Value )

?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Thomas StockbrueggerAuthor Commented:
Hi alb66,
this works      str_Remarks = CString( m_ptrRs->Fields->Item["Remarks"]->Value )
when I put a break point here..... I see all of the text in str_Remarks.
But later I would like to add this to my listview....and I just see only a part of it
m_List.SetItemText(1,2,str_Remarks)
 
I don´t know why.....that is strange....can you help?
Even if I also use>   str_Remarks.Replace("\r\n"," ")
0
Become a CompTIA Certified Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

alb66Commented:
I think there are some limits in CListCtrl. Try to use a CEdit instead, just to see if the text you retrieve is right.

http://msdn.microsoft.com/en-us/library/bb774760(VS.85).aspx
"Note that although the list-view control allows any length string to be stored as item text, only the first 260 TCHARs are displayed.
0
Thomas StockbrueggerAuthor Commented:
"I think there are some limits in CListCtrl. Try to use a CEdit instead, just to see if the text you retrieve is right"
-------------->   If I use a Editbox I see all the text/data.
"Note that although the list-view control allows any length string to be stored as item text, only the first 260 TCHARs are displayed."  
--------------> Can we change that?????
 
0
alb66Commented:
>>>> Can we change that?????

I think it is by design... you can try with a custom draw CListCtrl
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.