您的位置:首页 > 其它

VC中利用ODBC链接access中的问题

2013-12-19 15:57 309 查看
if (GetData()->nRefs > 1 || nMinBufLength > GetData()->nAllocLength)

我编程的时候,在access中增加一列数据,运行VC,报错,显示上面buf出错,怎么修改。

LPTSTR CString::GetBuffer(int nMinBufLength)

{

ASSERT(nMinBufLength >= 0);

if (GetData()->nRefs > 1 || nMinBufLength > GetData()->nAllocLength)

{

#ifdef _DEBUG

// give a warning in case locked string becomes unlocked

if (GetData() != _afxDataNil && GetData()->nRefs < 0)

TRACE0("Warning: GetBuffer on locked CString creates unlocked CString!\n");

#endif

// we have to grow the buffer

CStringData* pOldData = GetData();

int nOldLen = GetData()->nDataLength; // AllocBuffer will tromp it

if (nMinBufLength < nOldLen)

nMinBufLength = nOldLen;

AllocBuffer(nMinBufLength);

memcpy(m_pchData, pOldData->data(), (nOldLen+1)*sizeof(TCHAR));

GetData()->nDataLength = nOldLen;

CString::Release(pOldData);

}

ASSERT(GetData()->nRefs <= 1);

// return a pointer to the character storage for this string

ASSERT(m_pchData != NULL);

return m_pchData;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: