weixin_46065253
2021-09-06 20:55
采纳率: 100%
浏览 68

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条回答 默认 最新

相关推荐 更多相似问题