Public Class CCompanyManage Dim m_SQL As New CSQLInterface Const cst_TABLE_NAME As String = "CompanyManageTable" Dim m_COLS_NAME() As String = {"公司ID", "公司名称", "注册日期", "公司地址"} Private Enum COLS 公司ID 公司名称 注册日期 公司地址 End Enum '权限 Public Shared AccessRight As Integer = RIGHTS.NONE Public Sub New() End Sub Private Function QueryItem(ByVal CopID As String, ByRef CopName As String, ByRef CopDate As String, ByRef CopAddress As String) As ERROR_CODE If CBool(AccessRight And RIGHTS.READ) = False Then Return ERROR_CODE.NORIGHT End If Dim strSql As String = "SELECT * FROM " & cst_TABLE_NAME & " WHERE " strSql &= m_COLS_NAME(COLS.公司ID) & "=" & CopID Dim rTable As New System.Data.DataTable If SQL_Query(COL_RIGHTS.公司管理, strSql, rTable) = True Then CopName = rTable.Rows(0).Item(1) CopDate = rTable.Rows(0).Item(2) CopAddress = rTable.Rows(0).Item(3) Return ERROR_CODE.SUCCESS End If Return ERROR_CODE.ACCESS End Function End Class