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

📄 18802.html

📁 VB技巧问答10000例 VB技巧问答10000例
💻 HTML
字号:
<html>  <head>    <title>Re: 请教这个程式错在那里?</title>  </head>  <body bgcolor="#FFFFFF" vlink="#808080">    <center>      <h1>Re: 请教这个程式错在那里?</h1>    </center><hr size=7 width=75%><hr size=7 width=75%><p>Posted by 阿拉 on September 11, 1999 at 13:28:58:<p>In Reply to: <a href="18769.html">请教这个程式错在那里?</a> posted by kkcheung on September 10, 1999 at 16:18:33:<p>: selstr = "select * from sale_rec where sale_date like '" + Trim(T_FROM.Text) + "%'"<p>: Set tempset = FMSDB.OpenRecordset(selstr, dbOpenSnapshot, dbSQLPassThrough)<br>: If tempset.EOF Then<br>:     MsgBox "在指定条件下无查询资料 !", , FRM_KHGH_Q_P.Caption<br>:     MSG_BAR.Caption = ""<br>:     Exit Sub<br>: End If<br>: Do While Not tempset.EOF<br>: temp_inv = Trim(tempset.Fields!invo_code): temp_lot = Trim(tempset.Fields!stockno)<p>: selstr2 = "select * from receive_rec where stock_no='" + temp_lot + "'"<br>: Set tempset2 = FMSDB.OpenRecordset(selstr2, dbOpenSnapshot, dbSQLPassThrough)<p>: If Not tempset2.EOF Then<br>: temp_sendcode = Trim(tempset2.Fields!send_code)<br>: sqlSTR = "UPDATE sale_rec SET send_code= '" + temp_sendcode + "' WHERE invo_code='" + temp_inv + "' and stockno='" + temp_lot + "'"<br>: BeginTrans<br>: FMSDB.Execute sqlSTR, dbSQLPassThrough<br>: End If<p>: tempset.MoveNext<br>: tempset2.Close<br>: Loop<br>: 上面的程式可以顺利执行到第一次loop后,当第二次执行Set tempset2 = FMSDB.OpenRecordset(selstr2, dbOpenSnapshot, dbSQLPassThrough),就出现ODBC-call failed 3146.我作程式追踪,selstr2这句是完整的,抄到visdata亦可执行,但在这里却过了,请教问题出在那里.谢谢大家!<p>应该是有BeginTrans, 但没有CommitTrans<br><br><br><hr size=7 width=75%><p><a name="followups">Follow Ups:</a><br><ul><!--insert: 18802--><!--top: 18878--><li><a href="18878.html">Re: 请教这个程式错在那里?</a> <b>kkcheung</b> <i>16:17:18 9/13/99</i>(<!--responses: 18878-->0)<ul><!--insert: 18878--></ul><!--end: 18878--></ul><!--end: 18802--><br><hr size=7 width=75%><p></body></html>

⌨️ 快捷键说明

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