急我用ODBC方式访问数据库,取VARCHAR类型的字段,怎么最多只能取256个字节内容啊 最多取到256个字节的内容,超长的丢弃了,各位大虾有没有遇到这样的问题啊? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 CString str_sql;HSTMT hstmt;RETCODE nRetCode = SQLAllocHandle(SQL_HANDLE_STMT,m_pDatabase->DbcHandle(),&hstmt);if(SQL_SUCCESS != nRetCode){ return 1;} CString str_sql = "select ID,Content from t_BatchSendJob where id=1" nRetCode = SQLExecDirect(hstmtJOB, (unsigned char*)(LPCTSTR)str_sql, strlen(str_sql));if(SQL_SUCCESS != nRetCode){ return 1;} SQLINTEGER ID,qID,qContent;char Content[1000];SQLBindCol(hstmtJOB, 1, SQL_C_LONG, &ID, 0, &qID);SQLBindCol(hstmtJOB, 2, SQL_C_CHAR, &Content, 1000, &qContent);while(TRUE){ nRetCode = SQLFetch(hstmtJOB); if ((SQL_SUCCESS != nRetCode) && (SQL_SUCCESS_WITH_INFO != nRetCode)) break; strncpy(pJobInfo->Content, Content, strlen(Content));//就这里,取得的content只有256个字节}SQLCancel(hstmtJOB);SQLFreeStmt(hstmtJOB, SQL_CLOSE); 每人知道吗?我用的是ODBC API的方式,不是MFC的 疯了,VC++2010没有智能提示了 关于属性表单的一个问题 带图钉按扭的Dockbar 谁有能在windows media player播放器下端播放滚动文字信息的控件? 无法插入记录 ? 请教USB编程(急!!!) 如何在非中文系统中显示中文 这样的交换机如何欺骗进行嗅探!· 怎么修改已有的*.hlp文件? 在listctrl中添加新的item,如何添加后使新的item处于选择状态? 急:几天了,都没人能解决,期待高手.关于htmleditview. 调用API:SHBrowseForFolder()选择文件夹总是报错,为什么?
HSTMT hstmt;RETCODE nRetCode = SQLAllocHandle(SQL_HANDLE_STMT,m_pDatabase->DbcHandle(),&hstmt);
if(SQL_SUCCESS != nRetCode)
{
return 1;
} CString str_sql = "select ID,Content from t_BatchSendJob where id=1"
nRetCode = SQLExecDirect(hstmtJOB, (unsigned char*)(LPCTSTR)str_sql, strlen(str_sql));
if(SQL_SUCCESS != nRetCode)
{
return 1;
} SQLINTEGER ID,qID,qContent;
char Content[1000];
SQLBindCol(hstmtJOB, 1, SQL_C_LONG, &ID, 0, &qID);
SQLBindCol(hstmtJOB, 2, SQL_C_CHAR, &Content, 1000, &qContent);while(TRUE)
{
nRetCode = SQLFetch(hstmtJOB);
if ((SQL_SUCCESS != nRetCode) && (SQL_SUCCESS_WITH_INFO != nRetCode))
break;
strncpy(pJobInfo->Content, Content, strlen(Content));//就这里,取得的content只有256个字节
}
SQLCancel(hstmtJOB);
SQLFreeStmt(hstmtJOB, SQL_CLOSE);