clsworkflowlogin.cls

来自「欢迎您使用审批系统!该系统主要面向银行内部人员,但也为客户提供一些信息." 登陆」· CLS 代码 · 共 72 行

CLS
72
字号
VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
END
Attribute VB_Name = "clsWorkflowLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit

Private m_ErrorNumber As Long
Private m_ErrorDesc As String


Public Function Login(sConnectString As String, sUID As String, sPWD As String) As Boolean

  Dim oConnect As Connect.ClsDataConnect
  Dim oRS As ADODB.Recordset
  Dim sSQL As String
  Dim oError As Object

   sSQL = "SELECT UserName, Password from User where UserName='" & sUID & "' AND Password='" & sPWD & "'"

   If oConnect Is Nothing Then
      Set oConnect = CreateObject("Connect.clsDataConnect")
   End If
   
   If oConnect.Connect(sConnectString) Then
    
    If oConnect.ExecuteSQL(sSQL, 1) Then
       Set oRS = oConnect.RecSet
       
       If Not oRS Is Nothing Then
        If Not oRS.EOF Then
          Login = True
        Else
          Login = False
        End If
       End If
    Else
       Set oError = oConnect.Geterror
       m_ErrorNumber = oError.Error_Number
       m_ErrorDesc = oError.Error_Desc
    End If
  End If
   
   Exit Function

Error_Handler:
   Login = False
   Set oRS = Nothing
   Set oConnect = Nothing
End Function

Public Property Get ErrorNumber() As Long
   ErrorNumber = m_ErrorNumber
End Property

Public Property Let ErrorNumber(lData As Long)
   m_ErrorNumber = lData
End Property

Public Property Get ErrorDesc() As String
   ErrorDesc = m_ErrorDesc
End Property

Public Property Let ErrorDesc(sData As String)
   m_ErrorDesc = sData
End Property

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?