Click here to Skip to main content
15,914,943 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralAlternate for BEGIN_DISPATCH_MESSAGE in wtl Pin
saravananvv24-May-05 7:59
saravananvv24-May-05 7:59 
QuestionHow to convet GetIDispatch(FALSE) to atl Pin
saravananvv24-May-05 1:05
saravananvv24-May-05 1:05 
GeneralOutgoing IDispatch interface Pin
preethamr23-May-05 22:12
preethamr23-May-05 22:12 
QuestionHow to Connect to database in ntservice Pin
Yu_Matrix22-May-05 22:22
Yu_Matrix22-May-05 22:22 
AnswerRe: How to Connect to database in ntservice Pin
toxcct23-May-05 3:43
toxcct23-May-05 3:43 
AnswerRe: How to Connect to database in ntservice Pin
Sergey Solozhentsev30-May-05 5:30
Sergey Solozhentsev30-May-05 5:30 
Generalabout outlook addin Pin
Member 198215421-May-05 0:53
Member 198215421-May-05 0:53 
GeneralHELP!!! using DISTINCT keyword causes error 0x80040E21 Pin
oyinbogo19-May-05 11:43
oyinbogo19-May-05 11:43 
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, CMultipleResults> m_Accessor;<br />
<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

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.
GeneralError registering window class Pin
Fantmx19-May-05 10:15
Fantmx19-May-05 10:15 
GeneralRe: Error registering window class Pin
Michael Dunn19-May-05 20:17
sitebuilderMichael Dunn19-May-05 20:17 
GeneralRe: Error registering window class Pin
Fantmx20-May-05 3:05
Fantmx20-May-05 3:05 
GeneralRe: Error registering window class Pin
Michael Dunn20-May-05 9:20
sitebuilderMichael Dunn20-May-05 9:20 
GeneralRe: Error registering window class Pin
Fantmx20-May-05 10:19
Fantmx20-May-05 10:19 
GeneralRe: Error registering window class Pin
Michael Dunn20-May-05 12:14
sitebuilderMichael Dunn20-May-05 12:14 
GeneralRe: Error registering window class Pin
Fantmx3-Jun-05 8:48
Fantmx3-Jun-05 8:48 
Generalputting custom icons Pin
Anonymous19-May-05 3:48
Anonymous19-May-05 3:48 
QuestionSOS!Why I could not call the function from a dll? Pin
kiluar18-May-05 22:41
kiluar18-May-05 22:41 
AnswerRe: SOS!Why I could not call the function from a dll? Pin
Sergey Solozhentsev30-May-05 5:25
Sergey Solozhentsev30-May-05 5:25 
GeneralATL VC 7.xxx Pin
oscarferreira118-May-05 11:51
oscarferreira118-May-05 11:51 
Questionhelp: why a ATL control created in VC can not work well in vb? Pin
ictory18-May-05 3:29
ictory18-May-05 3:29 
AnswerRe: help: why a ATL control created in VC can not work well in vb? Pin
Jörgen Sigvardsson18-May-05 12:14
Jörgen Sigvardsson18-May-05 12:14 
Generalsimple c++ question Pin
Timothy_198217-May-05 0:53
Timothy_198217-May-05 0:53 
GeneralRe: simple c++ question Pin
James R. Twine17-May-05 1:23
James R. Twine17-May-05 1:23 
GeneralRe: simple c++ question Pin
Timothy_198217-May-05 1:27
Timothy_198217-May-05 1:27 
GeneralRe: simple c++ question Pin
James R. Twine17-May-05 3:31
James R. Twine17-May-05 3:31 

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.