RFX_Text replaces empty string with NULL ( ODBC MFC ASA )
darstan_at_yahoo.com
Date: 01/14/05
- Previous message: Lucas: "Accesing Paradox 7 databases"
- Messages sorted by: [ date ] [ thread ]
Date: 14 Jan 2005 08:28:10 -0800
//Common header (MasterHeader.h)
#ifndef _NULLFIX
#define RFX_Text EX_RFX_Text
#endif
//Source file.. RfxOverride.Cpp
#ifndef _NULL_SQL_FIX
#define EX_RFX_Text RFX_Text
#endif
// GLOBAL FUNCTION @ DBLayer
void EX_RFX_Text( CFieldExchange* pFX, LPCTSTR szColName, CString&
value, int nMaxLength /*= 255*/,
short nScale /* = 0*/ )
{
if( pFX->m_nOperation == CFieldExchange::MarkForUpdate &&
value.IsEmpty() )
{
LONG* len = pFX->m_prs->GetFieldLengthBuffer( pFX->m_nFields,
pFX->m_nFieldType );
if( len != NULL && *len != SQL_NULL_DATA )
{
*len = SQL_NTS;
//Tried this, doesn't help
//pFX->m_prs->SetFieldDirty( pFX->m_pvField );
//Tried this, doesn't help
//pFX->m_prs->SetFieldNull( pFX->m_pvField,FALSE );
TRACE("Setting %s to empty string\n", szColName );
}
}
RFX_Text( pFX, szColName, value, nMaxLength, nScale );
}
MFC : VC7
DBMS: Adaptive Server Anywhere 8.5
ODBC: 3.52
- Previous message: Lucas: "Accesing Paradox 7 databases"
- Messages sorted by: [ date ] [ thread ]