Click here to Skip to main content
15,888,142 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralFriday Brain Death - and a C/maths problem. Pin
Iain Clarke, Warrior Programmer20-Oct-06 2:31
Iain Clarke, Warrior Programmer20-Oct-06 2:31 
GeneralRe: Friday Brain Death - and a C/maths problem. Pin
Cedric Moonen20-Oct-06 2:46
Cedric Moonen20-Oct-06 2:46 
GeneralRe: Friday Brain Death - and a C/maths problem. Pin
Iain Clarke, Warrior Programmer20-Oct-06 3:23
Iain Clarke, Warrior Programmer20-Oct-06 3:23 
GeneralRe: Friday Brain Death - and a C/maths problem. Pin
Mr.Brainley20-Oct-06 2:58
Mr.Brainley20-Oct-06 2:58 
GeneralRe: Friday Brain Death - and a C/maths problem. Pin
Iain Clarke, Warrior Programmer20-Oct-06 3:25
Iain Clarke, Warrior Programmer20-Oct-06 3:25 
QuestionWNDPROC Pin
Waldermort20-Oct-06 2:13
Waldermort20-Oct-06 2:13 
AnswerRe: WNDPROC Pin
tanvon malik23-Oct-06 20:12
tanvon malik23-Oct-06 20:12 
QuestionStrange Bug Pin
Demian Panello20-Oct-06 1:57
Demian Panello20-Oct-06 1:57 
Hi.

I'm writing an application that it connects with a SQL database using ADO, and in many places it execute store procedures, but there is a routine that it doesn't work. This is the portion of code with the bug.

<br />
<br />
...<br />
Cmd->PutRefActiveConnection(pAdoCone);<br />
			<br />
Cmd->CommandText = "ProductsInOrders";<br />
Cmd->CommandType = adCmdStoredProc;<br />
<br />
vtidProduct.vt = VT_I4;<br />
vtidProduct.intVal  = (int)idProduct;		<br />
	<br />
paramID = Cmd->CreateParameter ("ProdID",adInteger,adParamInput,sizeof(int),vtidProduct);<br />
<br />
paramID->Value  = vtidProduct;<br />
			<br />
Cmd->Parameters->Append(paramID);<br />
<br />
Rs = Cmd->Execute(&vtMissing, &vtMissing, adCmdStoredProc);  <br />
<br />
// Clear the ListBox			<br />
m_lstOrders.ResetContent();<br />
<br />
// Here is the consecuence of bug: is always EOF 			<br />
while (!Rs->adoEOF)<br />
{<br />
  idOrder = Rs->GetFields()->GetItem("OrderID")->Value.iVal;<br />
				<br />
  data.Empty();<br />
				<br />
  data.Format("%i", idOrden); <br />
				<br />
  m_lstOrders.AddString (data);<br />
<br />
<br />
  Rs->MoveNext(); <br />
}<br />
...<br />


Well, it looks like the store procedure return 0 records, that's why the flow never enter the while, but I test the SP in SQL, (SQL 2000), and it works, and there is more, I wrote a little VB 6.0 application to test the SP and it works too!!. So, there's something wrong, (maybe is something stupid but I can't see it now, I'm blind!). Debugging, I can see right values for the parameter idProduct, I think the Execute method is wrong, because everything goes well until that line, then I get an empty recordset.D'Oh! | :doh:

If someone see what is wrong, I will really appreciate any suggestion.

Thanks.

Demian.

"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my telephone."

-Bjarne Stroustrup, computer science professor, designer of C++
programming language (1950- )

QuestionCurrent user registry problem Pin
Raul Simcic20-Oct-06 1:50
Raul Simcic20-Oct-06 1:50 
AnswerRe: Current user registry problem Pin
Iain Clarke, Warrior Programmer20-Oct-06 2:40
Iain Clarke, Warrior Programmer20-Oct-06 2:40 
AnswerRe: Current user registry problem Pin
Mark Salsbery20-Oct-06 9:29
Mark Salsbery20-Oct-06 9:29 
AnswerRe: Current user registry problem Pin
Gary R. Wheeler20-Oct-06 11:36
Gary R. Wheeler20-Oct-06 11:36 
QuestionRegCreateKeyEx - Problems on Win Vista RC2 [modified] Pin
Nick_Chr20-Oct-06 1:14
Nick_Chr20-Oct-06 1:14 
AnswerRe: RegCreateKeyEx - Problems on Win Vista RC2 Pin
David Crow20-Oct-06 2:57
David Crow20-Oct-06 2:57 
GeneralRe: RegCreateKeyEx - Problems on Win Vista RC2 Pin
Nick_Chr20-Oct-06 3:24
Nick_Chr20-Oct-06 3:24 
GeneralRe: RegCreateKeyEx - Problems on Win Vista RC2 Pin
David Crow20-Oct-06 3:33
David Crow20-Oct-06 3:33 
AnswerRe: RegCreateKeyEx - Problems on Win Vista RC2 Pin
Michael Dunn20-Oct-06 8:26
sitebuilderMichael Dunn20-Oct-06 8:26 
AnswerSOLVED IT : RegCreateKeyEx - Problems on Win Vista RC2 Pin
Nick_Chr22-Oct-06 22:46
Nick_Chr22-Oct-06 22:46 
QuestionPROG TO ERASE...help Pin
zetkonrad20-Oct-06 1:09
zetkonrad20-Oct-06 1:09 
AnswerRe: PROG TO ERASE...help Pin
benjymous20-Oct-06 1:21
benjymous20-Oct-06 1:21 
GeneralRe: PROG TO ERASE...help Pin
PJ Arends20-Oct-06 6:06
professionalPJ Arends20-Oct-06 6:06 
GeneralRe: PROG TO ERASE...help Pin
Gary R. Wheeler20-Oct-06 11:45
Gary R. Wheeler20-Oct-06 11:45 
GeneralRe: PROG TO ERASE...help Pin
PJ Arends20-Oct-06 15:42
professionalPJ Arends20-Oct-06 15:42 
AnswerRe: PROG TO ERASE...help Pin
Hamid_RT20-Oct-06 2:34
Hamid_RT20-Oct-06 2:34 
QuestionRe: PROG TO ERASE...help Pin
David Crow20-Oct-06 2:59
David Crow20-Oct-06 2:59 

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.