weixin_46065253 2021-09-06 20:55 采纳率: 100%
浏览 97
已结题

VB6未找到方法或数据成员#VB6

#VB6 未找到方法或数据成员
源代码如下:

Private Sub cmdOK_Click()
  Dim sUserName As String
  Dim sUserPwd As String
 sUserName = Trim(txtUserName.Text)
 sUserPwd = Trim(txtUserPwd.Text)
 If sUserName = "" Then
  Call MsgBox("请输人用户名!", vbOKOnly, "登录提示")
txtUserName.SetFocus
 Exit Sub
 End If
 If SqlConn.State <> adStateOpen Then DBConnect (" U ")
 Set SqlRS = execsql("select count(*) as num  from user_info where (hm='" + sUserName + "')and (pwd='" + sUserPwd + "')")
 If Not SqlRS.EOF Then
   If Int(Trim(SqlRS("num"))) >= 1 Then
 SqlRS.Close
 Set SqlRS = execsql("select hm ,role from user_info where (hm ='" + sUserName + "') and (pwd ='" + sUserPwd + "')")
  If Not SqlRS.EOF Then
     MDIForm1.SetRightForRole (Trim(SqlRS("role")))
  Else
     MDIForm1 SetRightForRole("2")
End If
 Unload Me
 MDIForm1.Show
Else
 Call MsgBox("用户名或密码错,请重新登录!", vbOKOnly, "登录提示")
 txtUserName.SetFocus
 Exit Sub
End If
End If
End Sub

.SetRightForRole报错,引用也添加了

  • 写回答

1条回答 默认 最新

  • 急速光粒 2021-09-06 21:47
    关注

    MDIForm1.SetRightForRole (Trim(SqlRS("role")))
    请确认这句SetRightForRole方法在MDIForm1中是否声明成public,默认private的。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 9月15日
  • 已采纳回答 9月7日
  • 创建了问题 9月6日

悬赏问题

  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用
  • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。