Click here to Skip to main content
15,923,083 members
Home / Discussions / Database
   

Database

 
GeneralRe: ADOCE.NET Pin
Abbas_Riazi20-May-05 9:31
professionalAbbas_Riazi20-May-05 9:31 
GeneralSql database modification Pin
webhay19-May-05 9:44
webhay19-May-05 9:44 
GeneralRe: Sql database modification Pin
Colin Angus Mackay19-May-05 22:54
Colin Angus Mackay19-May-05 22:54 
GeneralRe: Sql database modification Pin
webhay20-May-05 0:33
webhay20-May-05 0:33 
GeneralRe: Sql database modification Pin
Colin Angus Mackay20-May-05 0:42
Colin Angus Mackay20-May-05 0:42 
GeneralRe: Sql database modification Pin
webhay20-May-05 0:48
webhay20-May-05 0:48 
GeneralRe: Sql database modification Pin
GreggS20-May-05 6:08
GreggS20-May-05 6:08 
GeneralHELP!!! using distinct keyword causes error 0x80040E21 Pin
oyinbogo19-May-05 7:21
oyinbogo19-May-05 7:21 
Hi,

I'm using the ATL OLEDB classes and I get the following error:

"Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done."

when I query the database with a query that uses the "DISTINCT" keyword. Here is a sample of my code.

<br />
    HRESULT  hr;<br />
    CDataSource ds;<br />
    CSession session;<br />
    CCommand<CDynamicAccessor, CRowset> myAccessor;<br />
 <br />
    CComBSTR bstrUser(strUserId);<br />
    CComBSTR bstrPassword(strPasswd);<br />
    CComBSTR bstrServer(strSvrName);<br />
    CComBSTR bstrDatabase(strDbName);<br />
<br />
    CDBPropSet dbinit(DBPROPSET_DBINIT);<br />
    dbinit.AddProperty(DBPROP_AUTH_PASSWORD, bstrPassword);<br />
    dbinit.AddProperty(DBPROP_AUTH_PERSIST_SENSITIVE_AUTHINFO, false);<br />
    dbinit.AddProperty(DBPROP_AUTH_USERID, bstrUser);<br />
    dbinit.AddProperty(DBPROP_INIT_CATALOG, bstrDatabase);<br />
    dbinit.AddProperty(DBPROP_INIT_DATASOURCE, bstrServer);<br />
<br />
    // open a connection to sql server;<br />
    hr = ds.Open(_T("SQLOLEDB"), &dbinit);<br />
<br />
    // open a session <br />
    if ( SUCCEEDED(hr) )<br />
    {<br />
        hr = session.Open(ds);<br />
    }<br />
    else<br />
    {<br />
        session.Close();<br />
        ds.Close();<br />
        exit(1);<br />
    }<br />
<br />
    CDBPropSet  propset(DBPROPSET_ROWSET);<br />
    propset.AddProperty(DBPROP_IRowsetChange, true);<br />
    propset.AddProperty(DBPROP_IRowsetScroll, true);<br />
    propset.AddProperty(DBPROP_CANFETCHBACKWARDS, true);<br />
    propset.AddProperty(DBPROP_UPDATABILITY, <br />
     DBPROPVAL_UP_CHANGE | DBPROPVAL_UP_INSERT | DBPROPVAL_UP_DELETE );<br />
<br />
    char Query[] = "select distinct dl_num from deal"<br />
    LONG lRowsAffected = 0;<br />
    <br />
    hr = myAccessor.Open(m_session, Query, &propset, lRowsAffected);<br />


If I remove the DISTINCT keyword, the query works fine Frown | :(

Are there some things I need to set for the DISTINCT and GROUP BY keywords to work? We are using SQL Server 2000. Thanks for your help.
Generalhelp in undertsnading the joins Pin
satishrg19-May-05 5:31
satishrg19-May-05 5:31 
GeneralRe: help in undertsnading the joins Pin
Colin Angus Mackay19-May-05 6:39
Colin Angus Mackay19-May-05 6:39 
GeneralRe: help in undertsnading the joins Pin
satishrg19-May-05 7:58
satishrg19-May-05 7:58 
GeneralRe: help in undertsnading the joins Pin
Colin Angus Mackay19-May-05 12:34
Colin Angus Mackay19-May-05 12:34 
Questionproblem with update a row? Pin
Sasuko19-May-05 5:10
Sasuko19-May-05 5:10 
AnswerRe: problem with update a row? Pin
Colin Angus Mackay19-May-05 5:31
Colin Angus Mackay19-May-05 5:31 
GeneralRe: problem with update a row? Pin
Sasuko19-May-05 11:41
Sasuko19-May-05 11:41 
AnswerRe: problem with update a row? Pin
Luis Alonso Ramos19-May-05 14:09
Luis Alonso Ramos19-May-05 14:09 
GeneralRe: problem with update a row? Pin
Sasuko20-May-05 2:57
Sasuko20-May-05 2:57 
GeneralRe: problem with update a row? Pin
Sasuko20-May-05 4:19
Sasuko20-May-05 4:19 
GeneralRe: problem with update a row? Pin
Luis Alonso Ramos20-May-05 4:58
Luis Alonso Ramos20-May-05 4:58 
GeneralRe: problem with update a row? Pin
Sasuko20-May-05 5:00
Sasuko20-May-05 5:00 
GeneralRe: problem with update a row? Pin
Luis Alonso Ramos20-May-05 5:11
Luis Alonso Ramos20-May-05 5:11 
GeneralRe: problem with update a row? Pin
Sasuko20-May-05 5:21
Sasuko20-May-05 5:21 
GeneralRe: problem with update a row? Pin
Blue_Boy24-May-05 4:01
Blue_Boy24-May-05 4:01 
Generalpicture inserting.please help me! Pin
rohollahabadan19-May-05 2:20
rohollahabadan19-May-05 2:20 
GeneralRe: picture inserting.please help me! Pin
NewSilence21-May-05 12:11
NewSilence21-May-05 12:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.