如何将 wxTreeItemId 绑定为 sqlite3 数据库中的数据类型?

问题描述

我想让列插入 wxTreeItemId 作为值,我在 sqlite 中看到了这个数据类型 BLOB,它按原样接收数据,但我不确定 sqlite3_bind_blob() 需要什么作为参数,我有一个函数将 wxTreeItemId 的列更新为

{
    try
    {
        rc = sqlite3_open("Samples.db",&DB);

        std::string select = "UPDATE SAMPLES SET FAVORITEFOLDER = ? WHERE FILENAME = ?;";

        rc = sqlite3_prepare_v2(DB,select.c_str(),select.size(),&stmt,NULL);

---->   rc = sqlite3_bind_blob(sqlite3_stmt *,int,const void *,int n,void (*)(void *))

        rc = sqlite3_bind_text(stmt,2,Filename.c_str(),Filename.size(),SQLITE_STATIC);

        if (sqlite3_step(stmt) == SQLITE_ROW)
        {
            wxLogDebug("Record found,updating..");
        }

        rc = sqlite3_finalize(stmt);

        if (rc != SQLITE_OK)
        {
            msgDialog = new wxMessageDialog(NULL,"Error! Cannot update record.","Error",wxOK | wxICON_ERROR);
            msgDialog->ShowModal();
            sqlite3_free(ErrorMessage);
        }
        else
        {
            wxLogDebug("Updated record successfully.");
        }

        sqlite3_close(DB);
    }
    catch (const std::exception &exception)
    {
        wxLogDebug(exception.what());
    }
}

我想知道这些参数需要什么?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)