Updating DB table with CRecordset class
-
Hi , I am having problem sending CString data more than 255 character length to my Database Table through CRecordset class. I hav tried this thing both on SQL Server field(of type varchar (700) and also on ntext type) and MS Access field(of Text type). I m creating my CRecordset class through wizard pointing to database table with ODBC. CString ppp; ppp="somevalue" tstRs->m_res = ppp; now if ppp is less than 255 it works fine but if its more than 255 characters I get exception . does anybody know whats wrong ? and how to send a string more than 255 using CRecordset ???? Thanks in advance. ZINC
-
Hi , I am having problem sending CString data more than 255 character length to my Database Table through CRecordset class. I hav tried this thing both on SQL Server field(of type varchar (700) and also on ntext type) and MS Access field(of Text type). I m creating my CRecordset class through wizard pointing to database table with ODBC. CString ppp; ppp="somevalue" tstRs->m_res = ppp; now if ppp is less than 255 it works fine but if its more than 255 characters I get exception . does anybody know whats wrong ? and how to send a string more than 255 using CRecordset ???? Thanks in advance. ZINC
zinc_z wrote:
I am having problem sending CString data more than 255 character length to my Database Table through CRecordset class. I hav tried this thing both on SQL Server field(of type varchar (700) and also on ntext type) and MS Access field(of Text type).
Access tells you right in its design view that a text field can be no larger than 255 characters. See the online specifications here. It's also listed in your ACMAIN11.CHM (or ACMAIN10.CHM) file.
zinc_z wrote:
...I get exception .
What's the exception?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
-
Hi , I am having problem sending CString data more than 255 character length to my Database Table through CRecordset class. I hav tried this thing both on SQL Server field(of type varchar (700) and also on ntext type) and MS Access field(of Text type). I m creating my CRecordset class through wizard pointing to database table with ODBC. CString ppp; ppp="somevalue" tstRs->m_res = ppp; now if ppp is less than 255 it works fine but if its more than 255 characters I get exception . does anybody know whats wrong ? and how to send a string more than 255 using CRecordset ???? Thanks in advance. ZINC
An MS Access field of type Text is limited to 255 characters. If you want to store more than 255 characters, use a Memo field type. Why is common sense not common? Never argue with an idiot. They will drag you down to their level where they are an expert.
-
zinc_z wrote:
I am having problem sending CString data more than 255 character length to my Database Table through CRecordset class. I hav tried this thing both on SQL Server field(of type varchar (700) and also on ntext type) and MS Access field(of Text type).
Access tells you right in its design view that a text field can be no larger than 255 characters. See the online specifications here. It's also listed in your ACMAIN11.CHM (or ACMAIN10.CHM) file.
zinc_z wrote:
...I get exception .
What's the exception?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
-
An MS Access field of type Text is limited to 255 characters. If you want to store more than 255 characters, use a Memo field type. Why is common sense not common? Never argue with an idiot. They will drag you down to their level where they are an expert.