BUG #13124: OLEDB insert/update on rowset

Started by Nonameabout 11 years ago1 messagesbugs
Jump to latest
#1Noname
stejsky@volny.cz

The following bug has been logged on the website:

Bug reference: 13124
Logged by: Petr Stejskal
Email address: stejsky@volny.cz
PostgreSQL version: 9.4.1
Operating system: Windows Vista
Description:

Hello,
does the Postgresql oledb driver support Insert/Update operation?
I get the error E_NOINTERFACE (0x80004002) on Insert function.

see the code:

CoInitialize(NULL);
CDataSource db;
CSession session;
CDBPropSet dbinit(DBPROPSET_DBINIT);

dbinit.AddProperty(DBPROP_AUTH_INTEGRATED, "SSPI");
dbinit.AddProperty(DBPROP_AUTH_PERSIST_SENSITIVE_AUTHINFO, false);
dbinit.AddProperty(DBPROP_AUTH_USERID, "myuser");
dbinit.AddProperty(DBPROP_AUTH_PASSWORD, "pass");
dbinit.AddProperty(DBPROP_INIT_CATALOG, "mydatabase");
dbinit.AddProperty(DBPROP_INIT_DATASOURCE, "127.0.0.1");
dbinit.AddProperty(DBPROP_INIT_LCID, (long)1029);
dbinit.AddProperty(DBPROP_INIT_PROMPT, (short)4);
hr = db.OpenWithServiceComponents("PostgreSQL.1", &dbinit);
hr = session.Open(db);

CDBPropSet propsetI(DBPROPSET_ROWSET);
propsetI.AddProperty(DBPROP_IRowsetChange, true);
propsetI.AddProperty(DBPROP_UPDATABILITY, DBPROPVAL_UP_CHANGE |
DBPROPVAL_UP_INSERT | DBPROPVAL_UP_DELETE);
propsetI.AddProperty(DBPROP_CANFETCHBACKWARDS, true);

{
TRY_HRESULT(hr)
CCommand<CAccessor<CTEvent> > t;
hr = t.Open(session, "select * from abc", &propsetI);
t.m_EVENT_ID = 123;
t.m_idstatus = DBSTATUS_S_OK;
hr = t.Insert();
t.Close();
CATCH_HRESULT(hr)
}

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs