📄 subject_27613.htm
字号:
<p>
序号:27613 发表者:zhuning 发表日期:2003-01-13 23:02:43
<br>主题:ADO求助
<br>内容:小弟我在用VC开发连接SQL数据库的程序,ADO为接口<BR>我在实现查询的时候没有问题,可是当我要插入数据的时候,系统提示为<BR>IDispatch error 3119<BR>我在MSDN里查不到,老是卡在那,郁闷<BR>请高手指教
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
回复者:ax 回复日期:2003-01-14 09:04:57
<br>内容:_Recordset 不能执行insert into语句,执行insert into语句用connection或Command的Execute 方法,也可以用_Recordset的addnew 和update方法来添加数据.
<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>回复者:hillgg 回复日期:2003-01-15 14:09:48
<br>内容:CString sql<BR>sql = "Update d_code set Cname = '"+strCname+"',Ptype = '"+strPtype+"' where Place = '"+strPlace+"'";<BR> try<BR> {<BR> m_pCommand.CreateInstance(__uuidof(Command));<BR> m_pCommand->ActiveConnection = m_pConnection; // 将库连接赋于它<BR> m_pCommand->CommandText = _bstr_t(sql);//// SQL语句<BR> m_pCommand->Execute(NULL, NULL,adCmdText); // 执行SQL语句,返回记录集<BR> }<BR> catch(_com_error *e)<BR> {<BR> AfxMessageBox(e->ErrorMessage());<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>
回复者:hillgg 回复日期:2003-01-15 14:11:34
<br>内容:Insert:<BR><BR>sql = "Insert into d_code (Place,Cname,Ptype) Values('"+strPlace+"','"+strCname+"','"+strPtype+"')";
<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 + -