测试过程如下:m_ConnectionPtr.CreateInstance(__uuidof(Connection));
strCon = "Provider=PostgreSQL.1;Password=123;User ID=postgres;Data Source=localhost;Location=postgres;Extended Properties=\"\"";
m_ConnectionPtr->Open((_bstr_t)strCon,"","",adModeUnknown);m_RecordestPtr.CreateInstance(__uuidof(Recordset));
m_RecordestPtr->CursorLocation = adUseClient;
m_RecordestPtr->Open("SELECT * FROM bb",
_variant_t(m_ConnectionPtr, true),
adOpenDynamic,
adLockOptimistic,
adCmdText); m_RecordestPtr->AddNew();
m_RecordestPtr->PutCollect(_variant_t(long(0)),_variant_t((long)20)); //失败
m_RecordestPtr->Update(); //失败postgres中数据表结构:
表名:bb
字段:a 类型:integer请问失败是为什么啊;获取错误信息是未指定的错误
strCon = "Provider=PostgreSQL.1;Password=123;User ID=postgres;Data Source=localhost;Location=postgres;Extended Properties=\"\"";
m_ConnectionPtr->Open((_bstr_t)strCon,"","",adModeUnknown);m_RecordestPtr.CreateInstance(__uuidof(Recordset));
m_RecordestPtr->CursorLocation = adUseClient;
m_RecordestPtr->Open("SELECT * FROM bb",
_variant_t(m_ConnectionPtr, true),
adOpenDynamic,
adLockOptimistic,
adCmdText); m_RecordestPtr->AddNew();
m_RecordestPtr->PutCollect(_variant_t(long(0)),_variant_t((long)20)); //失败
m_RecordestPtr->Update(); //失败postgres中数据表结构:
表名:bb
字段:a 类型:integer请问失败是为什么啊;获取错误信息是未指定的错误
表是没有主键的为什么用addnew这种不行啊
以上程序 采用OLE DB的驱动
而采用ODBC的 就没有问题了
怀疑驱动有问题