Public Module mdl_Defs
    '权限定义
    Public Enum RIGHTS
        NONE = &H0
        READ = &H1
        WRITE = &H2
        READ_WRITE = &H3
        MANAGE = &H4
    End Enum

    '错误码定义
    Public Enum ERROR_CODE
        NONE
        SUCCESS
        NORIGHT
        ACCESS
    End Enum

    '退出原因
    Public Enum QUIT_RESON
        close
        logout
    End Enum

    '返回错误码字符串
    Public Function GetErrorCodeString(ByVal errorcode As ERROR_CODE) As String
        Select Case errorcode
            Case ERROR_CODE.SUCCESS
                Return ""
            Case ERROR_CODE.NORIGHT
                Return "无访问权限!"
            Case ERROR_CODE.ACCESS
                Return "访问数据库失败，请检查网络连接或联系管理员!"
            Case Else
                Return "未知错误"
        End Select
    End Function
End Module
