⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frm_yhgl.frm

📁 图书馆管理系统 对图书进行管理
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form frm_YHGL 
   BorderStyle     =   3  'Fixed Dialog
   ClientHeight    =   1830
   ClientLeft      =   3645
   ClientTop       =   2925
   ClientWidth     =   4335
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1830
   ScaleWidth      =   4335
   ShowInTaskbar   =   0   'False
   Begin VB.OptionButton Option4 
      Caption         =   "用户删除"
      ForeColor       =   &H00C000C0&
      Height          =   255
      Left            =   1320
      TabIndex        =   12
      Top             =   1500
      Width           =   1095
   End
   Begin VB.OptionButton Option3 
      Caption         =   "用户注册"
      ForeColor       =   &H00C000C0&
      Height          =   255
      Left            =   120
      TabIndex        =   11
      Top             =   1500
      Width           =   1095
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   375
      Left            =   120
      Top             =   2160
      Visible         =   0   'False
      Width           =   2175
      _ExtentX        =   3836
      _ExtentY        =   661
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   1
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=tsgl"
      OLEDBString     =   "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=tsgl"
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   "select * from usertb"
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.TextBox Text6 
      Height          =   375
      Left            =   2520
      TabIndex        =   10
      Top             =   2160
      Visible         =   0   'False
      Width           =   975
   End
   Begin VB.CommandButton Command3 
      Caption         =   "取消"
      Height          =   375
      Left            =   3480
      TabIndex        =   9
      Top             =   1440
      Width           =   855
   End
   Begin VB.Frame Frame1 
      Height          =   1335
      Left            =   0
      TabIndex        =   13
      Top             =   0
      Width           =   4335
      Begin VB.ComboBox Combo1 
         Height          =   300
         Left            =   1080
         Style           =   2  'Dropdown List
         TabIndex        =   15
         Top             =   720
         Width           =   2175
      End
      Begin VB.Label Label4 
         BackStyle       =   0  'Transparent
         Caption         =   "请输入您要删除的用户名称"
         Height          =   255
         Left            =   1080
         TabIndex        =   14
         Top             =   360
         Width           =   2175
      End
   End
   Begin VB.CommandButton Command2 
      Caption         =   "确定"
      Height          =   375
      Left            =   2520
      TabIndex        =   8
      Top             =   1440
      Width           =   855
   End
   Begin VB.Frame Frame2 
      Height          =   1335
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   4335
      Begin VB.TextBox Text3 
         Height          =   300
         IMEMode         =   3  'DISABLE
         Left            =   1560
         PasswordChar    =   "*"
         TabIndex        =   6
         Top             =   920
         Width           =   2535
      End
      Begin VB.TextBox Text2 
         Height          =   300
         IMEMode         =   3  'DISABLE
         Left            =   1560
         PasswordChar    =   "*"
         TabIndex        =   5
         Top             =   550
         Width           =   2535
      End
      Begin VB.TextBox Text1 
         Height          =   300
         Left            =   1560
         TabIndex        =   4
         Top             =   200
         Width           =   2535
      End
      Begin VB.Label Label3 
         Caption         =   "确认密码"
         ForeColor       =   &H00C00000&
         Height          =   225
         Left            =   240
         TabIndex        =   3
         Top             =   980
         Width           =   1215
      End
      Begin VB.Label Label2 
         Caption         =   "用户密码"
         ForeColor       =   &H00C00000&
         Height          =   375
         Left            =   240
         TabIndex        =   2
         Top             =   650
         Width           =   1215
      End
      Begin VB.Label Label1 
         Caption         =   "用户名称"
         ForeColor       =   &H00C00000&
         Height          =   375
         Left            =   240
         TabIndex        =   1
         Top             =   300
         Width           =   1335
      End
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确定"
      Height          =   375
      Left            =   2520
      TabIndex        =   7
      Top             =   1440
      Width           =   855
   End
End
Attribute VB_Name = "frm_YHGL"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim a
Private Sub Command1_Click()
    Adodc1.RecordSource = "select * from usertb"
    Adodc1.Refresh
    If Adodc1.Recordset.RecordCount > 0 Then
    Adodc1.Recordset.MoveLast
    Text6.Text = Val(Adodc1.Recordset.Fields("ID")) + 1
    Else
    Text6.Text = 1
    End If
  If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Then
  MsgBox "输入不完全!!", 48, "提示信息"
  Else
          If Text2.Text = Text3.Text Then
          cnn.Execute ("insert into usertb values(" & Text6 & ",'" & Text1 & "','" & Text2 & "')")
          MsgBox "注册成功!!", 48, "提示信息"
          Text1.Text = ""
          Text2.Text = ""
          Text3.Text = ""
          Unload Me
          Else
          MsgBox "两次输入的密码不一致,请您确认后重新输入", 48, "提示信息"
          Text2.Text = ""
          Text3.Text = ""
          Text2.SetFocus
          End If
  End If
End Sub

Private Sub Command2_Click()
    a = MsgBox("您确认要删除该用户吗?", 17, "提示信息")
    If a = vbOK Then
    Adodc1.RecordSource = "select * from usertb where 名称='" + Combo1.Text + "'"
    Adodc1.Refresh
    If Adodc1.Recordset.RecordCount > 0 Then
    Adodc1.Recordset.Delete
    Unload Me
    Else
    MsgBox "没有该用户的信息,请您确认后重新输入", 32, "提示信息"
    Text4.SetFocus
    End If
    Else
    End If
End Sub

Private Sub Command3_Click()
Unload Me
End Sub

Private Sub Command4_Click()
frm_RYXS.Show
frm_RYXS.Caption = "用户删除"
End Sub

Private Sub Form_Load()
Call Option3_Click
Option3.Value = True
Adodc1.RecordSource = "select * from usertb"
Adodc1.Refresh
  If Adodc1.Recordset.RecordCount > 0 Then
     Adodc1.Recordset.MoveFirst
        Do While Adodc1.Recordset.EOF = False
             Combo1.AddItem (Adodc1.Recordset.Fields("名称"))
             Adodc1.Recordset.MoveNext
        Loop
  Else
  End If
End Sub



Private Sub Option3_Click()
   Me.Caption = "用户注册"
   Frame2.Visible = True
   Frame1.Visible = False
   Command1.Visible = True
   Command2.Visible = False
End Sub

Private Sub Option4_Click()
   Me.Caption = "用户删除"
   Frame1.Visible = True
   Frame2.Visible = False
   Command2.Visible = True
   Command1.Visible = False
End Sub

Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text2.SetFocus
Else
End If
End Sub

Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text3.SetFocus
Else
End If
End Sub

Private Sub Text3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
  Call Command1_Click
Else
End If
End Sub

Private Sub Text4_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
    Call Command2_Click
Else
End If
End Sub

⌨️ 快捷键说明

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