论文无忧网提供:计算机毕业论文范文|计算机毕业设计|计算机毕业论文
栏目导航 ASP JSP .NET VB6.0 JAVA VC VF DELPHI PB 计算机网络 计算机科学与技术 PHP 其他 代写论文
当前位置: 网站首页 > 计算机 > VB6.0 >

A450vb图书管理系统(文档+源代码)

第五章 编码实现

5.1 程序编码

登陆界面如图5.1所示。 copyright paper51.com

paper51.com

图5.1登陆界面 http://www.paper51.com

程序代码如下:

内容来自www.paper51.com

Function Check_Password(ByVal UserName As String,ByVal UserPassword As String) As Integer 内容来自www.paper51.com

   On Error GoTo ER2: 内容来自www.paper51.com

   If ConnectToServer = True Then

copyright paper51.com

        SetobjRs = New Recordset

paper51.com

       StrSql = "select cOperatorPassword from tOperators wherecOperatorName='" & Trim(cboName.Text) & "'" 内容来自论文无忧网 www.paper51.com

       GetData StrSql 'Reference function to get data

copyright paper51.com

        IfobjRs.EOF Then paper51.com

           Check_Password = 0 'This Operator not exist

内容来自www.paper51.com

        Else

内容来自论文无忧网 www.paper51.com

          If txtPassword.Text <>Trim(objRs.Fields("cOperatorPassword").Value) Then

paper51.com

             Check_Password = 1 ' password error

http://www.paper51.com

          Else

copyright paper51.com

             Check_Password = 2 'password ok copyright paper51.com

             CurrentOpname = Trim(cboName.Text)

内容来自论文无忧网 www.paper51.com

             CurrentOppassword = objRs.Fields("cOperatorPassword").Value 内容来自www.paper51.com

             'Here can save a operator grade for expand 内容来自论文无忧网 www.paper51.com

          End If 内容来自www.paper51.com

        EndIf

内容来自论文无忧网 www.paper51.com

      objCon.Close

http://www.paper51.com

       ExitFunction 内容来自论文无忧网 www.paper51.com

ER2: 内容来自论文无忧网 www.paper51.com

   MsgBox Err.Description

内容来自论文无忧网 www.paper51.com

   Check_Password = 255 http://www.paper51.com

   End If

内容来自www.paper51.com

End Function paper51.com

Private Sub cmdCancel_Click()

内容来自www.paper51.com

   Unload Me

内容来自论文无忧网 www.paper51.com

   End

copyright paper51.com

End Sub 内容来自论文无忧网 www.paper51.com

Private Sub cmdOK_Click() paper51.com

   Dim intCheck As Integer 内容来自www.paper51.com

   'Static intLogTimes to save user login times

paper51.com

   Static intLogTimes As Integer http://www.paper51.com

   intLogTimes = intLogTimes + 1 'Save login times

内容来自论文无忧网 www.paper51.com

   If intLogTimes > MaxLogTimes Then 内容来自论文无忧网 www.paper51.com

       'Over allowed login times then list information

copyright paper51.com

       MsgBox "You have over allowed loghin times,login failure !",vbCritical, "LoginError"

内容来自www.paper51.com

       Unload Me

copyright paper51.com

   Else paper51.com

       intCheck = Check_Password(Trim(txtPassword), Trim(cboName)) copyright paper51.com

       Select Case intCheck

paper51.com

        Case0 内容来自www.paper51.com

           MsgBox "Your are not a system user !", vbInformation +vbOKOnly, "LoginError"

内容来自论文无忧网 www.paper51.com

        Case1 内容来自论文无忧网 www.paper51.com

           MsgBox "Password error ,please check your password !",vbInformation + vbOKOnly, "LoginError"

http://www.paper51.com

        Case2 paper51.com

            Unload Me

http://www.paper51.com

           If CurrentOpname = "Admin" And CurrentOppassword ="1" Then

http://www.paper51.com

               MainWin.mnuOp.Visible = True copyright paper51.com

           Else

内容来自www.paper51.com

               MainWin.mnuOp.Visible = False

paper51.com

           End If paper51.com

           Load MainWin

copyright paper51.com

           MainWin.Show 内容来自www.paper51.com

        EndSelect 内容来自www.paper51.com

      End If

http://www.paper51.com

End Sub copyright paper51.com

------分隔线----------------------------
联系方式