#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报错,引用也添加了