【正文】
k()Dim sql As String Set rsUser = New If = 1 Then sql = SELECT 密碼 FROM 登錄 WHERE 用戶名=39。 amp。 sql, conn, adOpenStatic, adLockPessimistic pwd = Trim((密碼))End SubPrivate Sub Command1_Click()If = Then MsgBox 請選擇用戶名!, , 登錄 Exit Sub End If If = Then MsgBox 請輸入密碼!, , 登錄 Exit Sub End If If = pwd Then userID = MsgBox 登陸成功! Else MsgBox 密碼無效,請重試!您還有 amp。 次機(jī)會, , 登錄 t = t + 1 If 3 t = 0 Then Unload Me End IfEnd IfEnd SubPrivate Sub Command2_Click()Unload MeEnd SubPrivate Sub Form_Load()Dim nstr As StringDim sql As String Set rsUser = New nstr = provider=。 data source= nstr sql = select 用戶名 from 登錄 sql, conn, adOpenStatic, adLockPessimistic Do Until (用戶名) Loop t = 0End Sub系統(tǒng)管理模塊系統(tǒng)管理模塊的功能是增加管理員、修改管理員密碼增加管理員模塊如圖所示:如果添加管理員與庫中重復(fù)則系統(tǒng)給出提示,如下圖所示增加用戶代碼Option ExplicitDim rs_add As New Private Sub Command1_Click(Index As Integer) Dim sql As String Set rs_add = New If Trim() = Then MsgBox 請輸入用戶名, vbOKOnly + vbExclamation, Exit Sub End If If Trim() = Then MsgBox 密碼不能為空, vbOKOnly + vbExclamation, Exit Sub End If If Trim() = Then MsgBox 請確認(rèn)密碼, vbOKOnly + vbExclamation, Exit Sub End If sql = select * from 登錄 where 用戶名 =39。 amp。 sql, conn, adOpenKeyset, adLockPessimistic If Then (1) = Trim() (2) = Trim() MsgBox 添加用戶成功!, vbOKOnly, Else MsgBox 用戶信息重復(fù)!, vbOKOnly + vbExclamation, = Exit Sub End IfEnd SubPrivate Sub Command2_Click(Index As Integer)Unload MeEnd SubPrivate Sub Form_Load() Dim nstr As String Dim sql As String Set conn = New nstr = Provider=。Persist Security Info=False nstrEnd Sub修改管理員密碼如圖所示:如果二次輸入密碼不一致,系統(tǒng)提示出錯,如下圖所示:如果二次輸入密碼一致,系統(tǒng)提示修改成功,如下圖所示:修改密碼代碼Private Sub Command1_Click() Dim rs_chang As New Dim sql As String If Trim() Trim() Then MsgBox 密碼不一致!, vbOKOnly + vbExclamation, = = Else sql = select * from 登錄 where 用戶名=39。 userID amp。 sql, conn, adOpenKeyset, adLockPessimistic (2) = MsgBox 密碼修改成功, vbOKOnly + vbExclamation, Unload Me End IfEnd SubPrivate Sub Command2_Click()Unload MeEnd SubPrivate Sub Form_Load()Dim nstr As String Dim sql As String Set conn = New nstr = Provider=。Persist Security Info=False nstrEnd Sub圖書管理模塊圖書管理模塊的功能是對圖書類別的添加和管理修改圖書類別模塊如下圖所示:修改成功如圖所示:如果要刪除圖書系統(tǒng)將給出提示,如下圖所示:修改圖書類別代碼Private Sub Form_Load() Dim nstr As String Dim sql As String Set conn = New nstr = Provider=。Persist Security Info=False nstrsql = select * from 圖書類別 = adUseClient sql, conn, adOpenKeyset, adLockPessimisticuserupdate = False = False = False = FalseSet = rsReaderEnd SubPrivate Sub Form_Unload(Cancel As Integer)Set = NothingEnd SubPrivate Sub usercancel_Click() = False = False = True = True = False = FalsUnload MeEnd SubPrivate Sub userdel_Clic