| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1881 人关注过本帖
标题:VC中利用ODBC链接access中的问题
只看楼主 加入收藏
ysy1231
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2013-10-16
收藏
 问题点数:0 回复次数:0 
VC中利用ODBC链接access中的问题
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;


}
搜索更多相关主题的帖子: warning access 
2013-11-28 16:29
快速回复:VC中利用ODBC链接access中的问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.024802 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved