哪位大侠知道:如何用 MySql++ 存取 Blob 字段啊?就是二进制字段,最好给个例子,不胜感激。。。 本帖最后由 HackerJLY 于 2013-01-29 09:58:14 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 百度很多啊http://www.cnblogs.com/haichang/archive/2011/04/03/2004359.html 读取搞定了void CprjMySqlPlusPlusTestDlg::OnBnClickedbtnbinaryread(){ // TODO: 在此添加控件通知处理程序代码 CString strTemp; mysqlpp::Connection ConnectionThis; bool bReturn = false; CString strMsg; size_t i; size_t j; char * pchar = NULL; const char * pconstchar = NULL; WCHAR * pwchar = NULL; string stringTemp; ostringstream ostringstreamThis; Face FaceThis; int iId = 0; int iLength = 0; void * pvoid = NULL; mysqlpp::sql_blob_null sql_blob_null_This; structTest structTestThis; //================================================================================================== //-------------------------------------------------------------------------------------------------- // Connect to the sample database. bReturn = ConnectionThis.connect("world", "localhost", "root", "root"); //ConnectionThis. if (!bReturn) { strTemp = ConnectionThis.error(); strMsg.Format(L"ConnectionThis.connect failed : %s", strTemp); MessageBox(strMsg); return; } m_strInfo.Empty(); // Retrieve a subset of the sample stock table set up by resetdb mysqlpp::Query QueryThis = ConnectionThis.query(); QueryThis << "SELECT * FROM FACE_LOG WHERE LOG_ID = 20"; mysqlpp::StoreQueryResult StoreQueryResultThis = QueryThis.store(); if(!StoreQueryResultThis) { strTemp = QueryThis.error(); strMsg.Format(L"QueryThis.store failed : %s", strTemp); MessageBox(strMsg); return; } sql_blob_null_This = StoreQueryResultThis[i][1]; iLength = sql_blob_null_This.data.length(); pconstchar = (const char *)sql_blob_null_This.data.data(); memcpy(&structTestThis, pconstchar, iLength); return;} 求对mysql单纯并发插入【写】的压力测试软件 php+mysql的论坛系统,论坛很多用户的权限不同,是不是对应的都是mysql数据库的一个用户呀? 新手急求高手解决方法!写一SQL语句 mysql的错误处理 请问如何按字段的某个字符串排序 mysql 中时间相减 两个表的连接查询。大虾们帮忙! 如何将MySql中的数据导入Excel中 mysql 查询丢失连接 mysql 数据量大的情况下如何优化 帮忙看下这个SQL语句怎么写呢?谢谢 MySQL性能偏低,请大牛帮分析
void CprjMySqlPlusPlusTestDlg::OnBnClickedbtnbinaryread()
{
// TODO: 在此添加控件通知处理程序代码
CString strTemp; mysqlpp::Connection ConnectionThis; bool bReturn = false; CString strMsg; size_t i; size_t j; char * pchar = NULL; const char * pconstchar = NULL; WCHAR * pwchar = NULL; string stringTemp;
ostringstream ostringstreamThis; Face FaceThis; int iId = 0; int iLength = 0; void * pvoid = NULL; mysqlpp::sql_blob_null sql_blob_null_This; structTest structTestThis;
//==================================================================================================
//--------------------------------------------------------------------------------------------------
// Connect to the sample database. bReturn = ConnectionThis.connect("world", "localhost", "root", "root");
//ConnectionThis.
if (!bReturn)
{
strTemp = ConnectionThis.error();
strMsg.Format(L"ConnectionThis.connect failed : %s", strTemp);
MessageBox(strMsg);
return;
} m_strInfo.Empty(); // Retrieve a subset of the sample stock table set up by resetdb
mysqlpp::Query QueryThis = ConnectionThis.query(); QueryThis << "SELECT * FROM FACE_LOG WHERE LOG_ID = 20";
mysqlpp::StoreQueryResult StoreQueryResultThis = QueryThis.store();
if(!StoreQueryResultThis)
{
strTemp = QueryThis.error();
strMsg.Format(L"QueryThis.store failed : %s", strTemp);
MessageBox(strMsg);
return;
} sql_blob_null_This = StoreQueryResultThis[i][1]; iLength = sql_blob_null_This.data.length(); pconstchar = (const char *)sql_blob_null_This.data.data(); memcpy(&structTestThis, pconstchar, iLength); return;
}