question

Giovanni-0686 avatar image
0 Votes"
Giovanni-0686 asked ·

Si sono verificati errori in un'operazione OLE DB composta da più passaggi

buonasera, non riesco a trovare una soluzione. sto provando di aprire una tabella con una query molto semplice SELECT DISTINCT X FROM XX WHERE X=A mi da questo errore Si sono verificati errori in un'operazione OLE DB composta da più passaggi. Controllare i singoli valori di stato OLE DB, se disponibili. Nessuna operazione eseguita. togliendo DISTINCT funziona il mio codice è su vs2019 MFC CDBPropSet propset2(DBPROPSET_ROWSET); propset2.AddProperty(DBPROP_IRowsetChange, true) propset2.AddProperty(DBPROP_UPDATABILITY, DBPROPVAL_UP_INSERT | DBPROPVAL_UP_CHANGE | DBPROPVAL_UP_DELETE) propset2.AddProperty(DBPROP_CANFETCHBACKWARDS, true); propset2.AddProperty(DBPROP_CANSCROLLBACKWARDS, true); CCommand<CManualAccessor> Record ; Record .Open(m_Sisson, Sql, &propset2, NULL, DBGUID_DBSQL, FALSE)

c++
· 5
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@Giovanni-0686

Currently in Microsoft Q&A we only support English, could you please edit your question into English?Then we can help to solve your issues, thanks for your understanding.

0 Votes 0 ·
Giovanni-0686 avatar image Giovanni-0686 JeanineZhang-MSFT ·

thanks ,
mi problem is

I can't find a solution. I'm trying to open a table with a very simple query like SELECT DISTINCT X FROM XX WHERE X=A . or adding GROUP BY
i get this error, There were errors in an OLE DB operation consisting of multiple steps. Check the individual OLE DB status values, if available. No action was taken.
removing DISTINCT works, my code is on vs2019 MFC


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

CCommand<CManualAccessor> Record ;
Record .Open(m_Sisson, Sql, &propset2, NULL, DBGUID_DBSQL, FALSE)

0 Votes 0 ·

@Giovanni-0686

As far as I'm concerned, It may be that the field types of the database do not match. I suggest you could try to check the fields's proprieties (type, length, default value, etc.), they should be the same.

0 Votes 0 ·
Show more comments

0 Answers