Click here to Skip to main content
15,902,112 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
QuestionFinding index of an array element?? Pin
Raza56801-Jan-11 16:25
Raza56801-Jan-11 16:25 
AnswerRe: Finding index of an array element?? Pin
Nuri Ismail3-Jan-11 1:57
Nuri Ismail3-Jan-11 1:57 
AnswerRe: Finding index of an array element?? Pin
jk chan4-Jan-11 5:46
jk chan4-Jan-11 5:46 
QuestionBasic string help -- Did I step into the Twilight Zone? Pin
Xpnctoc29-Dec-10 11:13
Xpnctoc29-Dec-10 11:13 
AnswerRe: Basic string help -- Did I step into the Twilight Zone? Pin
jk chan29-Dec-10 21:08
jk chan29-Dec-10 21:08 
AnswerRe: Basic string help -- Did I step into the Twilight Zone? Pin
Stephen Hewitt30-Dec-10 3:14
Stephen Hewitt30-Dec-10 3:14 
AnswerRe: Basic string help -- Did I step into the Twilight Zone? Pin
Xpnctoc30-Dec-10 6:14
Xpnctoc30-Dec-10 6:14 
QuestionCCommand execute stored procedure is failed! Pin
sergey-ka28-Dec-10 4:08
sergey-ka28-Dec-10 4:08 
Hi all!

I'am use ms sql server 2000 and msvs 2005 (visual c++)

Need to execute stored procedure in c++ client code.

On line
err = cmd.MoveFirst();
it's failed, because m_spRowset is NULL,
BUT then I remove line
update dbo.States set Name = '@' where StateId = 3 from stored procedure - it's OK?

What's wrong here?

Thanks for help!

sp code:
<br />
go<br />
alter procedure trans_GetList<br />
as<br />
begin<br />
update dbo.States set Name = '@' where StateId = 3<br />
<br />
select StateId from dbo.States<br />
end<br />
go<br />


c++ code:
<br />
CDataSource con;<br />
<br />
HRESULT err;<br />
    <br />
err = con.OpenFromInitializationString(L"...");<br />
   <br />
CSession session;<br />
<br />
err = session.Open(con);<br />
<br />
CCommand < CDynamicParameterAccessor, CBulkRowset, CMultipleResults > cmd;<br />
		<br />
err = cmd.Create(session, L"exec dbo.trans_GetList");<br />
err = cmd.Prepare();<br />
<br />
void *bufCmd = 0;<br />
<br />
err = cmd.BindParameters(&cmd.m_hParameterAccessor, cmd.m_spCommand, &bufCmd);<br />
err = cmd.Open(0, 0);	<br />
err = cmd.MoveFirst(); //Here is failed - m_spRowset is NULL<br />
<br />
while(err == S_OK)<br />
{<br />
   ...<br />
   err = cmd.MoveNext();<br />
}<br />
<br />
session.Close();<br />
con.Close();<br />

AnswerRe: CCommand execute stored procedure is failed! Pin
jerry_ch3-Oct-11 20:42
jerry_ch3-Oct-11 20:42 
QuestionOLE DB Provider with BOOKMARK capability Pin
RezaAsAdi22-Dec-10 8:53
RezaAsAdi22-Dec-10 8:53 
QuestionProblem in registering a 32 bit C++ COM/ATL Service on Windows7 64 bit? Pin
Aseem Sharma21-Dec-10 19:25
Aseem Sharma21-Dec-10 19:25 
AnswerRe: Problem in registering a 32 bit C++ COM/ATL Service on Windows7 64 bit? Pin
pacchij27-Dec-10 11:25
pacchij27-Dec-10 11:25 
GeneralRe: Problem in registering a 32 bit C++ COM/ATL Service on Windows7 64 bit? Pin
Aseem Sharma28-Dec-10 19:32
Aseem Sharma28-Dec-10 19:32 
GeneralRe: Problem in registering a 32 bit C++ COM/ATL Service on Windows7 64 bit? Pin
pacchij29-Dec-10 12:11
pacchij29-Dec-10 12:11 
Questioni have a quesstion about gcc warning Pin
lxlenovostar21-Dec-10 6:00
lxlenovostar21-Dec-10 6:00 
AnswerRe: i have a quesstion about gcc warning Pin
Richard MacCutchan21-Dec-10 8:23
mveRichard MacCutchan21-Dec-10 8:23 
QuestionPress a key using virtual key with SendInput Pin
vtalau20-Dec-10 23:37
vtalau20-Dec-10 23:37 
QuestionI have a question about the adobe reader Pin
quickzhao322316-Dec-10 22:42
quickzhao322316-Dec-10 22:42 
AnswerRe: I have a question about the adobe reader Pin
mav@octaval17-Dec-10 0:07
mav@octaval17-Dec-10 0:07 
GeneralRe: I have a question about the adobe reader Pin
quickzhao322317-Dec-10 17:51
quickzhao322317-Dec-10 17:51 
AnswerRe: I have a question about the adobe reader Pin
Richard MacCutchan17-Dec-10 1:52
mveRichard MacCutchan17-Dec-10 1:52 
GeneralRe: I have a question about the adobe reader Pin
quickzhao322317-Dec-10 17:55
quickzhao322317-Dec-10 17:55 
GeneralRe: I have a question about the adobe reader Pin
Richard MacCutchan17-Dec-10 23:25
mveRichard MacCutchan17-Dec-10 23:25 
AnswerRe: I have a question about the adobe reader Pin
jk chan17-Dec-10 2:02
jk chan17-Dec-10 2:02 
GeneralRe: I have a question about the adobe reader Pin
quickzhao322317-Dec-10 18:01
quickzhao322317-Dec-10 18:01 

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.