⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 subject_62978.htm

📁 vc
💻 HTM
字号:
<p>
序号:62978 发表者:little_friend 发表日期:2003-11-30 16:42:39
<br>主题:请问一个关于执行存储过程的问题
<br>内容:我利用ADO连接VC和MS SQL Server<BR>_ConnectionPtr&nbsp;&nbsp;&nbsp;&nbsp;m_pConnection;<BR>HCURSOR hCursor = AfxGetApp()-&gt;LoadStandardCursor(IDC_WAIT);<BR>SetCursor(hCursor);<BR>try<BR>{<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_pConnection.CreateInstance(__uuidof(Connection));<BR>&nbsp;&nbsp;&nbsp;&nbsp;CString sql_;<BR>&nbsp;&nbsp;&nbsp;&nbsp;sql_.Format(&#34;DSN=DataMining&#34;);<BR>&nbsp;&nbsp;&nbsp;&nbsp;sql=sql_;<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_pConnection-&gt;Open(sql,&#34;&#34;,&#34;&#34;,-1);<BR>}<BR>catch(_com_error&amp; e)<BR>{<BR>&nbsp;&nbsp;&nbsp;&nbsp;AfxMessageBox(e.ErrorMessage());<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>}&nbsp;&nbsp;&nbsp;&nbsp; <BR>try<BR>{<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_pConnection-&gt;Execute(&#34;eval&#34;,NULL,adCmdStoredProc);<BR>}<BR>catch(_com_error&amp; e)<BR>{<BR>&nbsp;&nbsp;&nbsp;&nbsp;AfxMessageBox(e.ErrorMessage());<BR>} <BR>其中DSN=DataMining,eval分别是数据源的名字和存储过程的名字,<BR>不知利用ADO执行存储过程是否有时间限制,为什么存储过程eval总是执行不完,而且不返回错误结果,但是,在SQL Server中运行EXEC eval却可以正常执行 <BR>
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
回复者:数据库 回复日期:2003-12-09 11:21:11
<br>内容:好像是有时间限制的,但具体的就不知道了.
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:david (小鱼儿) 回复日期:2003-12-09 12:15:25
<br>内容:commandtime
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -