GoLastError: MsgBox Err.Description End Sub Private Sub cmdNext_Click() On Error GoTo GoNextError If Not adoPrimaryRS.EOF Then adoPrimaryRS.MoveNext If adoPrimaryRS.EOF And adoPrimaryRS.RecordCount > 0 Then Beep 'moved off the end so go back adoPrimaryRS.MoveLast End If 'show the current record mbDataChanged = False Exit Sub GoNextError: MsgBox Err.Description End Sub Private Sub cmdPrevious_Click() On Error GoTo GoPrevError
If Not adoPrimaryRS.BOF Then adoPrimaryRS.MovePrevious If adoPrimaryRS.BOF And adoPrimaryRS.RecordCount > 0 Then Beep 'moved off the end so go back adoPrimaryRS.MoveFirst End If 'show the current record mbDataChanged = False Exit Sub GoPrevError: MsgBox Err.Description End Sub Private Sub SetButtons(bVal As Boolean) cmdAdd.Visible = bVal cmdEdit.Visible = bVal cmdUpdate.Visible = Not bVal cmdCancel.Visible = Not bVal cmdDelete.Visible = bVal cmdClose.Visible = bVal cmdRefresh.Visible = bVal cmdNext.Enabled = bVal cmdFirst.Enabled = bVal
cmdLast.Enabled = bVal cmdPrevious.Enabled = bVal End Sub 7.4档案的登陆和密码设计 本部分程序主要是提高系统的安全性,以防止非法用户进入本系统,避免不必要的损失。 Login.frm '是否合法用户 Public password As String Public user As String Dim db As Connection
Dim rs As Recordset Private Sub Command1_Click() If Trim(Text1.Text) = \ MsgBox \请输入完整!\Else If rs.State = adStateOpen Then rs.Close rs.Open \登录 where 用户名='\ If Not rs.EOF And Not rs.BOF Then If rs(\密码\ user = Text1.Text password = Text2.Text main.Show Unload Me Else MsgBox \密码错误!\ End If Else MsgBox \无此用户!\ End If End If End Sub
Private Sub Command2_Click() End End Sub Private Sub Form_Activate() Text1.SetFocus End Sub Private Sub Form_Load() 'Me.Width = 8000 'Me.Height = 6000 Set db = New Connection db.CursorLocation = adUseClient db.Open \ Set rs = New Recordset End Sub Private Sub Form_Unload(Cancel As Integer) rs.Close Set rs = Nothing db.Close Set db = Nothing End Sub
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库毕业论文--档案管理系统(7)在线全文阅读。
相关推荐: