Trying to following other SQL recommendations, many of my table columns do not allow NULLs.
However, when I have code like this:

recordSet.Edit();
recordSet.m_MyColumn = '';
recordSet.Update();

With "MyColumn" not allowing NULLs, I get the exception "Cannot insert NULL values into column..."

This is because of this code in MFC during DoFieldExchange RFX_Text (DBRFX.cpp)

case CFieldExchange::MarkForUpdate:
if (value.IsEmpty())
pFX->m_prs->SetNullFieldStatus(nField - 1);
else
pFX->m_prs->ClearNullFieldStatus(nField - 1);

value.IsEmpty is TRUE, so the field (column) is marked as NULL.

Any suggestions how to get the empty string into MyColumn?


Thanks for reading this far.

Jim O'Leary