CRecordset::Update() fails while updating long values 
Author Message
 CRecordset::Update() fails while updating long values

I'm using MSSQL 7.0.........wrote a small program using MFC which updates
some fields in the DB.
There is a field of varchar(5000) type. The update method works if the value
which I'm trying to put in is not very long. Otherwise it doesn't work.

Does anybody have any ideas why that happens?



Sat, 01 Feb 2003 03:00:00 GMT  
 CRecordset::Update() fails while updating long values

Quote:

> I'm using MSSQL 7.0.........wrote a small program using MFC which updates
> some fields in the DB.
> There is a field of varchar(5000) type. The update method works if the value
> which I'm trying to put in is not very long. Otherwise it doesn't work.

> Does anybody have any ideas why that happens?

Subclasses of the CRecordset created by the class wizard uses a default maximum
string length of 255 characters. To use larger strings you must add an extra
argument to the macro call "RFX_Text" int the DoFieldExchange method.

For example, this method works for a table consisting of a single varchar field
that is 5000 characters long:

void MyTable::DoFieldExchange(CFieldExchange* pFX)
{
 //{{AFX_FIELD_MAP(MyTable)
 pFX->SetFieldType(CFieldExchange::outputColumn);
 RFX_Text(pFX, _T("[LongString]"), m_LongString, 5000);
 //}}AFX_FIELD_MAP

Quote:
}



Sun, 02 Feb 2003 03:00:00 GMT  
 CRecordset::Update() fails while updating long values
What symptoms/errors are you seeing?  Any assertions?


Quote:

> I'm using MSSQL 7.0.........wrote a small program using MFC which updates
> some fields in the DB.
> There is a field of varchar(5000) type. The update method works if the
value
> which I'm trying to put in is not very long. Otherwise it doesn't work.

> Does anybody have any ideas why that happens?



Sun, 02 Feb 2003 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. CRecordset->Update(), But no Update

2. CRecordset does not update LONGs ?

3. Error updating decimal values via CRecordset::Udate

4. CRecordset Update - Invalid argument value

5. addition long values to long double value ?

6. SQL/VC++ Updates: Can't update recordset

7. Vicious Leak, Updated Update.

8. Slow update using CRecordset class

9. Why CRecordset can't update Excel spreadsheet - the answer

10. CRecordset: AddNew...Update

11. Can CRecordset update an Excel spreadsheet

 

 
Powered by phpBB® Forum Software