I need to pass a CString which sometimes contains more than 255 characters.
How can I do that?
Printable View
I need to pass a CString which sometimes contains more than 255 characters.
How can I do that?
Where to pass?Quote:
Originally Posted by Radu
Please be more explicit.
Quote:
Originally Posted by Radu
A CString object can store up to INT_MAX (2,147,483,647) characters. Why you are fearing for just 255 characters?
Have a look at below link...
http://msdn.microsoft.com/library/de...tring_data.asp
ok, I have an array of strings. I need to copy a number of entries in this array to a single CString variable, something like:
for (int i = 0; i < 10; i++)
myStr += myStrArray[i];
So, if the number of characters in these entries exceeds 255 then myStr won't contain the rest which exceeds 255.
:cool:Quote:
Originally Posted by santoct2002
Are you sure? Just try this:
Code:CString strBig(_T('A'), INT_MAX - 1);
so, any idea what I can do about this?
Yes...I am sure... :cool:Quote:
Originally Posted by micknustiunimik
Just add this:Quote:
Originally Posted by Radu
and I assure you can get more than 255.Code:int nLength = myStr.GetLength();
Possible you have seen max. 255 in the output window. There is a limitation, indeed.
Well...post your code where you fill the string...Quote:
Originally Posted by Radu
Are you sure based on that ASSERT(nLen <= INT_MAX-1) from CString::AllocBuffer?Quote:
Originally Posted by Andreas Masur
ok, if I read the length it gives me more than 255 so probably it is indeed the limitation of the watch?!
So, the problem must be somewhere else. The thing is, I am exporting this string into a cell of an excel sheet and in the sheet I am seeing only 255 characters so first i thought it was a limitation of the cell length in the sheet but if I fill a cell by hand with more than 255 chars, it works. So now I'm pretty lost about where the problem could be....
thanks anyway guys!
If you still should have an idea, please let me know!
How are you doing that?Quote:
Originally Posted by Radu
Using ODBC
RFX_Text has a 255 character limit. That's probably your problem.Quote:
Originally Posted by Radu
No...I am sure based in the class code itself...Quote:
Originally Posted by micknustiunimik
oh dammit!! I was fearing something like that...
Thanks GCDEF!
Any idea what I can do about it?
Read up on RFX_LongBinary. It's a little more involved, but that's what you use for transferring large amounts of data.Quote:
Originally Posted by Radu
Well, but INT_MAX (2,147,483,647) is bigger than the usable space for a Win32 process, e.g. 2,147,352,576 for NT.Quote:
Originally Posted by Andreas Masur
Right!
Never trust a stuff before test it! :D
So? It is stilll valid that a 'CString' can hold up to INT_MAX - 1 characters...whether the underlying operating system supports it or not is a different story.... :cool:Quote:
Originally Posted by micknustiunimik
In fact it cannot. Just it tries. :)Quote:
Originally Posted by Andreas Masur
Bringing up an old post... is there a way around this? i am trying to write more text to an access database using OBDC and RecordSetQuote:
Originally Posted by GCDEF
any suggestions?
I don't think an Access text field can hold more than 255 characters anyway. As I mentioned earler, RFX_LongBinary will let you transfer BLOBs.Quote:
Originally Posted by Drabert
Hi Drabert,Quote:
Originally Posted by Drabert
I was trying to do something with RFX_LongBinary but didn't get too far because it's not straightforward and I didn't have the time to go too deep on that. However if you find a solution, I would appreciate alot if you could tell me how it works!! :)
Hope to hear from you!
Yes, the Access text field cannot hold more than 255 characters. However, the Memo field can. The memo field limit depends on the MS Access version.Quote:
Originally Posted by GCDEF
From MSDN (ACC: Concatenation of Memo Fields Creates Text Field ):Quote:
Text fields have a limit of 255 characters; Memo fields can contain up to 32,000 characters in Microsoft Access 1.x, and up to 64,000 characters in Microsoft Access 2.0 or later.
ok i did a lot more research on here and found what you were talking about with the memo field but i am getting the truncate problem because the CString is too large... i tried this
RFX_Text(pDX, IDC_DESCRIPTION, m_pSet->m_Description, 1500,SQL_LONGVARCHAR);
but it didnt work... still getting the truncate problem...
any sugestions? or am i totally doing this incorrectly?