www.pudn.com > 西南医院.rar > FrmAdminDel.frm


VERSION 5.00 
Begin VB.Form FrmAdminDel  
   Caption         =   "用户删除" 
   ClientHeight    =   2535 
   ClientLeft      =   60 
   ClientTop       =   345 
   ClientWidth     =   4440 
   LinkTopic       =   "Form1" 
   MaxButton       =   0   'False 
   MDIChild        =   -1  'True 
   ScaleHeight     =   2535 
   ScaleWidth      =   4440 
   Begin VB.Data Data1  
      Caption         =   "Data1" 
      Connect         =   "Access 2000;" 
      DatabaseName    =   "" 
      DefaultCursorType=   0  'DefaultCursor 
      DefaultType     =   2  'UseODBC 
      Exclusive       =   0   'False 
      Height          =   345 
      Left            =   1800 
      Options         =   0 
      ReadOnly        =   0   'False 
      RecordsetType   =   1  'Dynaset 
      RecordSource    =   "" 
      Top             =   1560 
      Visible         =   0   'False 
      Width           =   1215 
   End 
   Begin VB.CommandButton Command6  
      Caption         =   ">>" 
      BeginProperty Font  
         Name            =   "MS Sans Serif" 
         Size            =   9.75 
         Charset         =   0 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   400 
      Left            =   3240 
      TabIndex        =   10 
      Top             =   1920 
      Width           =   975 
   End 
   Begin VB.CommandButton Command5  
      Caption         =   ">" 
      BeginProperty Font  
         Name            =   "MS Sans Serif" 
         Size            =   9.75 
         Charset         =   0 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   400 
      Left            =   3240 
      TabIndex        =   9 
      Top             =   1320 
      Width           =   975 
   End 
   Begin VB.CommandButton Command4  
      Caption         =   "<" 
      BeginProperty Font  
         Name            =   "MS Sans Serif" 
         Size            =   9.75 
         Charset         =   0 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   400 
      Left            =   3240 
      TabIndex        =   8 
      Top             =   840 
      Width           =   975 
   End 
   Begin VB.CommandButton Command3  
      Caption         =   "<<" 
      BeginProperty Font  
         Name            =   "MS Sans Serif" 
         Size            =   9.75 
         Charset         =   0 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   400 
      Left            =   3240 
      TabIndex        =   7 
      Top             =   360 
      Width           =   975 
   End 
   Begin VB.Frame Frame1  
      Caption         =   "查找" 
      BeginProperty Font  
         Name            =   "MS Sans Serif" 
         Size            =   9.75 
         Charset         =   0 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   2295 
      Left            =   3120 
      TabIndex        =   6 
      Top             =   120 
      Width           =   1215 
   End 
   Begin VB.CommandButton Command2  
      Caption         =   "关闭" 
      BeginProperty Font  
         Name            =   "MS Sans Serif" 
         Size            =   9.75 
         Charset         =   0 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   495 
      Left            =   1680 
      TabIndex        =   5 
      Top             =   1920 
      Width           =   1215 
   End 
   Begin VB.CommandButton Command1  
      Caption         =   "删除" 
      BeginProperty Font  
         Name            =   "MS Sans Serif" 
         Size            =   9.75 
         Charset         =   0 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   495 
      Left            =   120 
      TabIndex        =   4 
      Top             =   1920 
      Width           =   1215 
   End 
   Begin VB.TextBox Text2  
      Height          =   495 
      IMEMode         =   3  'DISABLE 
      Left            =   1200 
      PasswordChar    =   "*" 
      TabIndex        =   3 
      Top             =   1080 
      Width           =   1575 
   End 
   Begin VB.TextBox Text1  
      Height          =   495 
      Left            =   1200 
      TabIndex        =   2 
      Top             =   240 
      Width           =   1575 
   End 
   Begin VB.Label Label2  
      Caption         =   "密  码" 
      BeginProperty Font  
         Name            =   "MS Sans Serif" 
         Size            =   12 
         Charset         =   0 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   255 
      Left            =   120 
      TabIndex        =   1 
      Top             =   1080 
      Width           =   855 
   End 
   Begin VB.Label Label1  
      Caption         =   "用户名" 
      BeginProperty Font  
         Name            =   "MS Sans Serif" 
         Size            =   12 
         Charset         =   0 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   255 
      Left            =   120 
      TabIndex        =   0 
      Top             =   240 
      Width           =   855 
   End 
End 
Attribute VB_Name = "FrmAdminDel" 
Attribute VB_GlobalNameSpace = False 
Attribute VB_Creatable = False 
Attribute VB_PredeclaredId = True 
Attribute VB_Exposed = False 
Private Sub Command1_Click() 
On Error GoTo err 
If Data1.Recordset.RecordCount < 1 Then 
   Text1.Text = "" 
   Text2.Text = "" 
   MsgBox "数据库中无数据", vbOKOnly + vbCritical, "系统提示" 
   Exit Sub 
End If 
If Text1.Text = "admin" Then 
   MsgBox "超级用户不能删除", vbOKOnly + vbCritical, "系统提示" 
   Exit Sub 
End If 
Data1.Recordset.Delete 
Data1.Recordset.MoveNext 
If Data1.Recordset.EOF = False Then 
   Data1.Recordset.MoveLast 
End If 
disp 
err: 
If err.Number = 3021 Then 
   MsgBox "无当前记录", vbOKOnly + vbQuestion, "系统信息" 
   Text1.Text = "" 
   Text2.Text = "" 
   Exit Sub 
End If 
End Sub 
 
Private Sub Command2_Click() 
Unload Me 
FrmMdi.mnuuserdel.Checked = False 
End Sub 
 
Private Sub Command3_Click() 
If Data1.Recordset.RecordCount < 1 Then 
   MsgBox "数据库中无数据", vbOKOnly + vbCritical, "系统提示" 
   Exit Sub 
End If 
Data1.Recordset.MoveFirst 
disp 
End Sub 
 
Private Sub Command4_Click() 
If Data1.Recordset.RecordCount < 1 Then 
   MsgBox "数据库中无数据", vbOKOnly + vbCritical, "系统提示" 
   Exit Sub 
End If 
Data1.Recordset.MovePrevious 
If Data1.Recordset.BOF Then 
   Data1.Recordset.MoveFirst 
End If 
disp 
End Sub 
 
Private Sub Command5_Click() 
If Data1.Recordset.RecordCount < 1 Then 
   MsgBox "数据库中无数据", vbOKOnly + vbCritical, "系统提示" 
   Exit Sub 
End If 
Data1.Recordset.MoveNext 
If Data1.Recordset.EOF Then 
   Data1.Recordset.MoveLast 
End If 
disp 
End Sub 
 
Private Sub Command6_Click() 
If Data1.Recordset.RecordCount < 1 Then 
   MsgBox "数据库中无数据", vbOKOnly + vbCritical, "系统提示" 
   Exit Sub 
End If 
Data1.Recordset.MoveLast 
disp 
End Sub 
 
Private Sub Form_Load() 
Me.Height = 2940 
Me.Width = 4560 
Data1.DatabaseName = App.Path & "\message.mdb" 
Data1.RecordSource = "admin" 
Data1.Refresh 
disp 
End Sub 
Sub disp() 
On Error Resume Next 
    Text1.Text = Data1.Recordset.Fields("id") 
    Text2.Text = Data1.Recordset.Fields("pwd") 
End Sub 
 
Private Sub Form_Unload(Cancel As Integer) 
FrmMdi.mnuuserdel.Checked = False 
End Sub