| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 926 人关注过本帖
标题:[求助]未找到方法或数据成员
只看楼主 加入收藏
lyh820803
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2005-4-6
收藏
 问题点数:0 回复次数:2 
[求助]未找到方法或数据成员

我执行下面的程序,可他告诉我"未找到方法或数据成员" 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
griefforyou
Rank: 6Rank: 6
等 级:贵宾
威 望:27
帖 子:3336
专家分:0
注 册:2004-4-15
收藏
得分:0 
Private Sub Command1_Click(Index As Integer)
...
End Sub

Private Sub Command4_Click(Index As Integer)
Unload Me
End Sub
Command1和Command4是控件数组吗,为什么有index参数?

天津网站建设 http://www./
2005-04-21 21:02
lyh820803
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2005-4-6
收藏
得分:0 
我要是把Index As Integer去掉的话,他就说"过程声明与同名事件或过程的描述不匹配"

2005-04-21 21:05
快速回复:[求助]未找到方法或数据成员
数据加载中...
 
   



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

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