13834.html

来自「以电子书的形式收集了VB一些常见问题解决方法,可以很方便的查找自己需要解决的问题」· HTML 代码 · 共 26 行

HTML
26
字号
<html>
  <head>
    <title>请教这个程式错在什么?</title>
  </head>
  <body bgcolor="#FFFFFF" vlink="#808080">
    <center>
      <h1>请教这个程式错在什么?</h1>
    </center>
<hr size=7 width=75%>

<hr size=7 width=75%><p>
Posted by kkcheung on June 04, 1999 at 11:48:41:<p>
Private Sub Form_Load()<br>Public horse_no As Integer, DB As Database, RS As Recordset<br>Public p_win As Single, temp_rs As Recordset, temp_winpay As Integer, temp_p_pay As Integer, temp_step As Integer, temp_step2 As Integer, temp_post As Integer<br>Private Sub Form_Load()<p>Set DB = OpenDatabase("C:\RACE\RACE.MDB")<br>Set RS = DB.OpenRecordset("horse", dbOpenDynaset)Dim temp_winpay As Integer, temp_p_pay As Integer, temp_step As Integer, temp_step2 As Integer, temp_post As Integer<p>For i = 1 To 10<br>temp_winpay = Int(Rnd(2) * 100)<br>temp_p_pay = Int(Rnd(2) * 100)<br>temp_step = Int(Rnd(2) * 10)<br>temp_step2 = temp_step<br>temp_post = temp_step<br>Addrs RS, temp_winpay, temp_p_pay, temp_step, temp_step2, temp_post<br>Next<br>End Sub<br>Function Addrs(temp_rs As Recordset, temp_winpay As Integer, temp_p_pay As Integer, temp_step As Integer, temp_step2 As Integer, temp_post As Integer)<p>    With temp_rs<br>        .AddNew  <==============执行时在这里出错!<br>        !horse_no = temp_winpay<br>        !w_pay = temp_p_pay<br>        !step1 = temp_step<br>        !step2 = temp_step<br>        !postion = temp_step<br>        .Update<br>        .Bookmark = .LastModified<br>    End With<br>End Function<p>执行后出现"执行期错误 91",没有设定物件变数或with区块变数.<br>上面的程式,是否可以再简单一此
<br>
<br><hr size=7 width=75%><p>
<a name="followups">Follow Ups:</a><br>
<ul><!--insert: 13834-->
<!--top: 13841--><li><a href="13841.html">程式是不容易看出系统问题, 只能找逻辑问题, 试一试 ...</a> <b>安宝</b> <i>13:30:22 6/04/99</i>
(<!--responses: 13841-->0)
<ul><!--insert: 13841-->
</ul><!--end: 13841-->
</ul><!--end: 13834-->
<br><hr size=7 width=75%><p>

</body></html>

⌨️ 快捷键说明

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