标题:[求助]未找到方法或数据成员
取消只看楼主
lyh820803
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2005-4-6
 问题点数:0 回复次数:1 
[求助]未找到方法或数据成员

我执行下面的程序,可他告诉我"未找到方法或数据成员" Option Explicit Dim rs As New ADODB.Recordset

Private Function check1() As Boolean On Error GoTo errh Set rs = cn.Execute("SELECT num FROM room1 WHERE num='" & Trim(num.Text) & "'") If rs.EOF Then rs.Close check1 = True Exit Function End If check1 = False rs.Close Exit Function errh: rs.Close MsgBox Err.Description End Function

Private Sub Command1_Click(Index As Integer) On Error GoTo AddErr

If num.Text = "" Then MsgBox "请输入教室号!", vbOKOnly + vbExclamation, "警告" num.SetFocus Exit Sub End If If chair.Text = "" Then MsgBox "请输入桌椅数量!", vbOKOnly + vbExclamation, "警告" chair.SetFocus Exit Sub End If If Combo1.Text = "" Then MsgBox "请输入是否有投影仪!", vbOKOnly + vbExclamation, "警告" Combo1.SetFocus Exit Sub End If If window.Text = "" Then MsgBox "请输入窗户数量!", vbOKOnly + vbExclamation, "警告" window.SetFocus Exit Sub End If If door.Text = "" Then MsgBox "请输入门数量!", vbOKOnly + vbExclamation, "警告" door.SetFocus Exit Sub End If If text6.Text = "" Then MsgBox "请输入分发日期!出生年月应输入日期格式(YYYY-MM-DD)!", vbOKOnly + vbExclamation, "警告" text6.SetFocus Exit Sub End If If person.Text = "" Then MsgBox "请输入负责人姓名!", vbOKOnly + vbExclamation, "警告" person.SetFocus Exit Sub End If If tool.Text = "" Then MsgBox "请输入工具数量!", vbOKOnly + vbExclamation, "警告" tool.SetFocus Exit Sub End If If note.Text = "" Then MsgBox "请输入注释信息!", vbOKOnly + vbExclamation, "警告" note.SetFocus Exit Sub End If If Combo2.Text = "" Then MsgBox "请输入是否有电脑!", vbOKOnly + vbExclamation, "警告" Combo2.SetFocus Exit Sub End If

Exit Sub End If

If check1 = False Then MsgBox "教室号重复!", vbOKOnly + vbExclamation, "警告" num.SetFocus Else Adodc1.Recordset.AddNew Adodc1.Recordset.Fields("num").Value = num.Text Adodc1.Recordset.Fields("desk").Value = desk.Text Adodc1.Recordset.Fields("window").Value = window.Text Adodc1.Recordset.Fields("Projector").Value = Combo1.Text Adodc1.Recordset.Fields("date").Value = text6.Text Adodc1.Recordset.Fields("door").Value = door.Text Adodc1.Recordset.Fields("led").Value = led.Text Adodc1.Recordset.Fields("person").Value = person.Text Adodc1.Recordset.Fields("note").Value = note.Text Adodc1.Recordset.Fields("computer").Value = Combo2.Text Adodc1.Recordset.Update MsgBox "添加成功!", vbOKOnly + vbExclamation, "警告" Exit Sub End If AddErr: MsgBox Err.Description Exit Sub End Sub

Private Sub Command4_Click(Index As Integer) Unload Me End Sub

搜索更多相关主题的帖子: 数据成员 Function num Close 
2005-04-21 17:23
lyh820803
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2005-4-6
得分:0 
我要是把Index As Integer去掉的话,他就说"过程声明与同名事件或过程的描述不匹配"

2005-04-21 21:05



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-16286-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.601263 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved