本帖最后由 HackerJLY 于 2013-01-29 09:58:14 编辑

解决方案 »

  1.   

    百度很多啊http://www.cnblogs.com/haichang/archive/2011/04/03/2004359.html
      

  2.   

    读取搞定了
    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;
    }