引擎提示找不到usysPurview对象,涉及usysPurview的有三段代码,高手看一下怎么回事?
(第一段)
Private Function IconLableClick(ByVal intNum As Integer)
Dim PurviewOption As Boolean
PurviewOption = False
If Not IsLoaded("frmLogin") Then
MsgBox "您没有登陆,请您登陆后在使用本系统", vbInformation, SoftName
DoCmd.OpenForm "frmLogin", , , , , acDialog
Else
Dim rs As ADODB.Recordset, strSQL As String
Set rs = New ADODB.Recordset
strSQL = "select * from usysPurview where (UserID=" & Forms("frmLogin")!UserID & ") and (MenuItem=" & NowWorkSpace & ") and (ItemNumber=" & intNum & ");"
rs.Open strSQL, CurrentProject.Connection, adOpenStatic, adLockReadOnly
If rs.EOF Then
MsgBox "您没有使用该功能的权限,请与系统管理员联系!", vbExclamation, SoftName
ElseIf Not rs("PurviewOption") Then
MsgBox "您没有使用该功能的权限,请与系统管理员联系!", vbExclamation, SoftName
Else
PurviewOption = True
End If
rs.Close
Set rs = Nothing
End If
If PurviewOption Then
RunItemCommand intNum
End If
End Function
(第二段)
Private Sub SavePurview(ByVal intUserID As Long)
Dim rs As ADODB.Recordset, strSQL As String, I As Integer, j As Integer
Set rs = New ADODB.Recordset
If DLookup("userid", "usysuser", "userid=" & intUserID) > 0 Then
strSQL = "select * from usyspurview where userid=" & intUserID & " order by menuitem,itemnumber;"
rs.Open strSQL, CurrentProject.Connection, adOpenDynamic, adLockOptimistic
If rs.EOF Then
For I = 1 To 5
For j = 1 To 5
If Me("P" & Format(I, "0") & Format(j, "0")).Visible Then
rs.AddNew
rs("userid") = intUserID
rs("menuitem") = I
rs("itemnumber") = j
rs("purviewoption") = Me("P" & Format(I, "0") & Format(j, "0"))
rs.Update
End If
Next
Next
Else
Do While Not rs.EOF
If Me("P" & Format(rs("menuitem"), "0") & Format(rs("itemnumber"), "0")).Visible Then
rs("purviewoption") = Me("P" & Format(rs("menuitem"), "0") & Format(rs("itemnumber"), "0"))
End If
rs.MoveNext
Loop
End If
End If
rs.Close
Set rs = Nothing
End Sub
(第三段)
Private Sub ShowInfo()
Dim rs As ADODB.Recordset, strSQL As String
Set rs = New ADODB.Recordset
strSQL = "select * from usyspurview where userid=" & UserList & " order by MenuItem,ItemNumber;"
rs.Open strSQL, CurrentProject.Connection, adOpenStatic, adLockReadOnly
Do While Not rs.EOF
If Me("P" & Format(rs("menuitem"), "0") & Format(rs("itemnumber"), "0")).Visible Then
Me("P" & Format(rs("menuitem"), "0") & Format(rs("itemnumber"), "0")) = rs("PurviewOption")
End If
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
username = UserList.Column(1)
End Sub