
Writing MSSQL TEXT field from CRecordset
Hopefully this is a simple question for someone. We are using MSSQL
as the platform for a new B/AR system to replace an aging system. I
am trying to write a report to a TEXT field so that once the report is
created, it can be easily viewed or printed on demand by our users.
This is a plain text report that will not be over one or two pages.
We are using Visual C++ and ODBC. When using Class Wizard to create a
derived CRecordset class for the table, the TEXT field is mapped as a
CString. I have tried writing the report to the CString and updating
the record in the standard way. This method gives me a "data
truncation" error.
Can a TEXT field be written, updated, and read using the CRecordset
class? I have access to MSDN, and have found little documentation
regarding the TEXT and IMAGE fields in MSSQL except for T-SQL.
If CRecordset is not the way to go, what is the least complicated way
of updating these type of fields from a VC++ MFC/ODBC application.
Your help is greatly appreciated.
Sincerely,
Bradley Powers