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

📄 s_admin.frm

📁 一个很好的软件
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form S_admin 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "学号管理(添加新数据后按更新有效)"
   ClientHeight    =   3000
   ClientLeft      =   1095
   ClientTop       =   330
   ClientWidth     =   5190
   KeyPreview      =   -1  'True
   LinkTopic       =   "Form3"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3000
   ScaleWidth      =   5190
   ShowInTaskbar   =   0   'False
   Begin VB.CommandButton cmdLast 
      Height          =   300
      Left            =   4800
      Picture         =   "S_admin.frx":0000
      Style           =   1  'Graphical
      TabIndex        =   18
      Top             =   2700
      UseMaskColor    =   -1  'True
      Width           =   345
   End
   Begin VB.CommandButton cmdNext 
      Height          =   300
      Left            =   4440
      Picture         =   "S_admin.frx":0342
      Style           =   1  'Graphical
      TabIndex        =   17
      Top             =   2700
      UseMaskColor    =   -1  'True
      Width           =   345
   End
   Begin VB.CommandButton cmdPrevious 
      Height          =   300
      Left            =   480
      Picture         =   "S_admin.frx":0684
      Style           =   1  'Graphical
      TabIndex        =   16
      Top             =   2700
      UseMaskColor    =   -1  'True
      Width           =   345
   End
   Begin VB.CommandButton cmdFirst 
      Height          =   300
      Left            =   120
      Picture         =   "S_admin.frx":09C6
      Style           =   1  'Graphical
      TabIndex        =   15
      Top             =   2700
      UseMaskColor    =   -1  'True
      Width           =   345
   End
   Begin VB.Frame Frame1 
      Caption         =   "学号管理"
      Height          =   2325
      Left            =   200
      TabIndex        =   9
      Top             =   120
      Width           =   4815
      Begin VB.ComboBox combo1 
         BackColor       =   &H80000004&
         Height          =   300
         ItemData        =   "S_admin.frx":0D08
         Left            =   2760
         List            =   "S_admin.frx":0D18
         TabIndex        =   21
         Text            =   "请选择类别"
         Top             =   1920
         Width           =   1455
      End
      Begin VB.TextBox Text1 
         BackColor       =   &H80000004&
         Height          =   300
         Left            =   720
         TabIndex        =   20
         Text            =   "关键字"
         Top             =   1920
         Width           =   1935
      End
      Begin VB.CommandButton begin 
         Height          =   300
         Left            =   4320
         Picture         =   "S_admin.frx":0D35
         Style           =   1  'Graphical
         TabIndex        =   19
         Top             =   1920
         UseMaskColor    =   -1  'True
         Width           =   345
      End
      Begin VB.TextBox txtFields 
         BackColor       =   &H80000004&
         DataField       =   "专业"
         DataSource      =   "datPrimaryRS"
         Height          =   285
         Index           =   0
         Left            =   720
         TabIndex        =   3
         Top             =   1200
         Width           =   3975
      End
      Begin VB.TextBox txtFields 
         BackColor       =   &H80000004&
         DataField       =   "性别"
         DataSource      =   "datPrimaryRS"
         Height          =   285
         Index           =   1
         Left            =   720
         TabIndex        =   1
         Top             =   555
         Width           =   3975
      End
      Begin VB.TextBox txtFields 
         BackColor       =   &H80000004&
         DataField       =   "姓名"
         DataSource      =   "datPrimaryRS"
         Height          =   285
         Index           =   2
         Left            =   720
         TabIndex        =   2
         Top             =   870
         Width           =   3975
      End
      Begin VB.TextBox txtFields 
         BackColor       =   &H80000004&
         DataField       =   "学号"
         DataSource      =   "datPrimaryRS"
         Height          =   285
         Index           =   3
         Left            =   720
         TabIndex        =   0
         Top             =   210
         Width           =   3975
      End
      Begin VB.TextBox txtFields 
         BackColor       =   &H80000004&
         DataField       =   "学院"
         DataSource      =   "datPrimaryRS"
         Height          =   285
         Index           =   4
         Left            =   720
         TabIndex        =   4
         Top             =   1515
         Width           =   3975
      End
      Begin VB.Label Label1 
         Caption         =   "查询:"
         Height          =   255
         Left            =   120
         TabIndex        =   22
         Top             =   1965
         Width           =   495
      End
      Begin VB.Label lblLabels 
         Caption         =   "专业:"
         Height          =   255
         Index           =   0
         Left            =   120
         TabIndex        =   14
         Top             =   1225
         Width           =   495
      End
      Begin VB.Label lblLabels 
         Caption         =   "性别:"
         Height          =   255
         Index           =   1
         Left            =   120
         TabIndex        =   13
         Top             =   540
         Width           =   495
      End
      Begin VB.Label lblLabels 
         Caption         =   "姓名:"
         Height          =   255
         Index           =   2
         Left            =   120
         TabIndex        =   12
         Top             =   890
         Width           =   495
      End
      Begin VB.Label lblLabels 
         Caption         =   "学号:"
         Height          =   255
         Index           =   3
         Left            =   120
         TabIndex        =   11
         Top             =   255
         Width           =   615
      End
      Begin VB.Label lblLabels 
         Caption         =   "学院:"
         Height          =   255
         Index           =   4
         Left            =   120
         TabIndex        =   10
         Top             =   1550
         Width           =   540
      End
   End
   Begin VB.CommandButton cmdAdd 
      Caption         =   "添加(&A)"
      Height          =   300
      Left            =   840
      TabIndex        =   5
      Top             =   2700
      Width           =   855
   End
   Begin VB.CommandButton cmdUpdate 
      Caption         =   "更新(&U)"
      Height          =   300
      Left            =   1680
      TabIndex        =   6
      Top             =   2700
      Width           =   855
   End
   Begin VB.CommandButton cmdDelete 
      Caption         =   "删除(&D)"
      Height          =   300
      Left            =   2520
      TabIndex        =   7
      Top             =   2700
      Width           =   975
   End
   Begin VB.CommandButton cmdClose 
      Caption         =   "关闭(&C)"
      Height          =   300
      Left            =   3480
      TabIndex        =   8
      Top             =   2700
      Width           =   975
   End
   Begin MSAdodcLib.Adodc datPrimaryRS 
      Height          =   330
      Left            =   600
      Top             =   2760
      Visible         =   0   'False
      Width           =   2295
      _ExtentX        =   4048
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   "PROVIDER=Microsoft.Jet.OLEDB.3.51;Data Source=libary.mdb;"
      OLEDBString     =   "PROVIDER=Microsoft.Jet.OLEDB.3.51;Data Source=libary.mdb;"
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   "select 专业,性别,姓名,学号,学院 from S_no Order by 学号"
      Caption         =   " "
      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
End
Attribute VB_Name = "S_admin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'读者信息查询的实现(为了数据更新的方便)
Private Sub begin_Click()
Select Case combo1.ListIndex
Case 0
datPrimaryRS.Recordset.Find "学号 ='" & Text1.Text & "'", 1
If datPrimaryRS.Recordset.EOF Then
datPrimaryRS.Recordset.MoveFirst
datPrimaryRS.Recordset.Find "学号 ='" & Text1.Text & "'"
End If
Case 1
datPrimaryRS.Recordset.Find "姓名 ='" & Text1.Text & "'", 1
If datPrimaryRS.Recordset.EOF Then
datPrimaryRS.Recordset.MoveFirst
datPrimaryRS.Recordset.Find "姓名 ='" & Text1.Text & "'"
End If
Case 2
datPrimaryRS.Recordset.Find "学院 ='" & Text1.Text & "'", 1
If datPrimaryRS.Recordset.EOF Then
datPrimaryRS.Recordset.MoveFirst
datPrimaryRS.Recordset.Find "学院 ='" & Text1.Text & "'"
End If
Case 3
datPrimaryRS.Recordset.Find "专业 ='" & Text1.Text & "'", 1
If datPrimaryRS.Recordset.EOF Then
datPrimaryRS.Recordset.MoveFirst
datPrimaryRS.Recordset.Find "专业 ='" & Text1.Text & "'"
End If
End Select
End Sub

'----此处用的是VB数据向导生成的窗体-----
Private Sub cmdFirst_Click()
 On Error GoTo GoLastError
  datPrimaryRS.Recordset.MoveFirst
  Exit Sub
GoLastError:
  MsgBox Err.Description
End Sub

Private Sub cmdLast_Click()
  On Error GoTo GoLastError
    datPrimaryRS.Recordset.MoveLast
   Exit Sub
GoLastError:
  MsgBox Err.Description
End Sub

Private Sub cmdNext_Click()
 On Error GoTo GoLastError
  If Not datPrimaryRS.Recordset.EOF Then
  datPrimaryRS.Recordset.MoveNext
  Else
  datPrimaryRS.Recordset.MoveFirst
  End If
  Exit Sub
GoLastError:
  MsgBox Err.Description
End Sub

Private Sub cmdPrevious_Click()
On Error GoTo GoLastError
  If Not datPrimaryRS.Recordset.BOF Then
  datPrimaryRS.Recordset.MovePrevious
  Else
  datPrimaryRS.Recordset.MoveLast
  End If
  Exit Sub
GoLastError:
  MsgBox Err.Description
End Sub

Private Sub Form_Load()
Me.Icon = Form1.Icon
Left = (Screen.Width - Me.Width) \ 2
Top = (Screen.Height - Me.Height) \ 2
End Sub

Private Sub Form_Unload(cancel As Integer)
  Screen.MousePointer = vbDefault
End Sub

Private Sub datPrimaryRS_Error(ByVal ErrorNumber As Long, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, fCancelDisplay As Boolean)
  '错误处理程序代码置于此处
  '想要忽略错误,注释掉下一行
  '想要捕获它们,在此添加代码以处理它们
  MsgBox "Data error event hit err:" & Description
End Sub


Private Sub cmdAdd_Click()
  On Error GoTo AddErr
  datPrimaryRS.Recordset.AddNew

  Exit Sub
AddErr:
  MsgBox Err.Description
End Sub

Private Sub cmdDelete_Click()
  On Error GoTo DeleteErr
  With datPrimaryRS.Recordset
    .Delete
    .MoveNext
    If .EOF Then .MoveLast
  End With
  Exit Sub
DeleteErr:
  MsgBox Err.Description
End Sub



Private Sub cmdUpdate_Click()
  On Error GoTo UpdateErr

  datPrimaryRS.Recordset.UpdateBatch adAffectAll '更新所有输入的记录
  Exit Sub
UpdateErr:
  MsgBox Err.Description
End Sub

Private Sub cmdClose_Click()
  Unload Me
End Sub

⌨️ 快捷键说明

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