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

📄 frmsdcheck.frm

📁 学生宿舍管理系统vb源码
💻 FRM
字号:
VERSION 5.00
Object = "{CFA7AFF4-3242-4269-9172-7389D695AE01}#1.0#0"; "stonexp.ocx"
Begin VB.Form frmSDCheck 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "住宿信息查询"
   ClientHeight    =   2160
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   5640
   Icon            =   "frmSDCheck.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   2160
   ScaleWidth      =   5640
   StartUpPosition =   3  '窗口缺省
   Begin StoneXP.XPFrame XPFrame1 
      Height          =   2175
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   5655
      _ExtentX        =   9975
      _ExtentY        =   3836
      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
      Begin VB.TextBox txtDorm 
         Appearance      =   0  'Flat
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   3600
         TabIndex        =   10
         Top             =   960
         Width           =   1815
      End
      Begin VB.TextBox txtNo 
         Appearance      =   0  'Flat
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   960
         TabIndex        =   4
         Top             =   360
         Width           =   1815
      End
      Begin VB.TextBox txtName 
         Appearance      =   0  'Flat
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   3600
         TabIndex        =   3
         Top             =   360
         Width           =   1815
      End
      Begin VB.TextBox txtClass 
         Appearance      =   0  'Flat
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   960
         TabIndex        =   2
         Top             =   960
         Width           =   1815
      End
      Begin StoneXP.XPButton cmbCheck 
         Default         =   -1  'True
         Height          =   375
         Left            =   3360
         TabIndex        =   1
         Top             =   1560
         Width           =   855
         _ExtentX        =   1508
         _ExtentY        =   661
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Caption         =   "查询"
         MouseIcon       =   "frmSDCheck.frx":06EA
         MousePointer    =   99
      End
      Begin StoneXP.XPButton cmbCancle 
         Height          =   375
         Left            =   4440
         TabIndex        =   5
         Top             =   1560
         Width           =   855
         _ExtentX        =   1508
         _ExtentY        =   661
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Caption         =   "取消"
         MouseIcon       =   "frmSDCheck.frx":0A04
         MousePointer    =   99
      End
      Begin VB.Label Label4 
         Appearance      =   0  'Flat
         BackColor       =   &H80000005&
         BackStyle       =   0  'Transparent
         Caption         =   "宿舍"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   255
         Left            =   3000
         TabIndex        =   9
         Top             =   1080
         Width           =   855
      End
      Begin VB.Label Label1 
         Appearance      =   0  'Flat
         BackColor       =   &H80000005&
         BackStyle       =   0  'Transparent
         Caption         =   "学号"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   255
         Left            =   240
         TabIndex        =   8
         Top             =   480
         Width           =   855
      End
      Begin VB.Label Label2 
         Appearance      =   0  'Flat
         BackColor       =   &H80000005&
         BackStyle       =   0  'Transparent
         Caption         =   "姓名"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   255
         Left            =   3000
         TabIndex        =   7
         Top             =   480
         Width           =   855
      End
      Begin VB.Label Label3 
         Appearance      =   0  'Flat
         BackColor       =   &H80000005&
         BackStyle       =   0  'Transparent
         Caption         =   "班级"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   255
         Left            =   240
         TabIndex        =   6
         Top             =   1080
         Width           =   855
      End
   End
End
Attribute VB_Name = "frmSDCheck"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmbCancle_Click()
    '取消时显示所有已分配宿舍学生信息,查询涉及Student、Dorm、Student_Dorm三个表
    QuaryString = "select Student.Stu_Key,Student.Stu_Name,Student.Stu_Sex,Student.Stu_Class,"
    QuaryString = QuaryString & "Student.Stu_Polit,Student_Dorm.Dor_Id,Dorm.Dor_Num,Dorm.Dor_Fact "
    QuaryString = QuaryString & "from Student inner join Student_Dorm ON Student.Stu_Key = Student_Dorm.Stu_Key "
    QuaryString = QuaryString & "INNER JOIN Dorm ON Student_Dorm.Dor_Id = Dorm.Dor_Id"
    Unload Me
End Sub

Private Sub cmbCheck_Click()
    '根据用户输入内容生成数据库查询语句
    Dim isFirst As Boolean
    '判断用户是否输入查询条件
    If Trim(txtNo.Text) = "" And Trim(txtName.Text) = "" And Trim(txtClass.Text) = "" And Trim(txtDorm.Text) = "" Then
        MsgBox "请输入查询条件!", vbOKOnly + vbExclamation, "提示"
        Exit Sub
    End If
    isFirst = True
    '连接查询语句
    QuaryString = "select Student.Stu_Key,Student.Stu_Name,Student.Stu_Sex,Student.Stu_Class,"
    QuaryString = QuaryString & "Student.Stu_Polit,Student_Dorm.Dor_Id,Dorm.Dor_Num,Dorm.Dor_Fact "
    QuaryString = QuaryString & "from Student inner join Student_Dorm ON Student.Stu_Key = Student_Dorm.Stu_Key "
    QuaryString = QuaryString & "INNER JOIN Dorm ON Student_Dorm.Dor_Id = Dorm.Dor_Id where"
    If Trim(txtNo.Text) <> "" Then  '学号不为空
        QuaryString = QuaryString & " Student.Stu_Key='" & Trim(txtNo.Text) & "'"
        isFirst = False
    End If
    If Trim(txtName.Text) <> "" Then    '姓名不为空
        If isFirst = False Then
            QuaryString = QuaryString & " and Student.Stu_Name='" & Trim(txtName.Text) & "'"
        Else
            QuaryString = QuaryString & " Student.Stu_Name='" & Trim(txtName.Text) & "'"
            isFirst = False
        End If
    End If
    If Trim(txtClass.Text) <> "" Then   '班级不为空
        If isFirst = False Then
            QuaryString = QuaryString & " and Student.Stu_Class='" & Trim(txtClass.Text) & "'"
        Else
            QuaryString = QuaryString & " Student.Stu_Class='" & Trim(txtClass.Text) & "'"
            isFirst = False
        End If
    End If
    If Trim(txtDorm.Text) <> "" Then    '宿舍不为空
        If isFirst = False Then
            QuaryString = QuaryString & " and Student_Dorm.Dor_Id='" & Trim(txtDorm.Text) & "'"
        Else
            QuaryString = QuaryString & " Student_Dorm.Dor_Id='" & Trim(txtDorm.Text) & "'"
            isFirst = False
        End If
    End If
    Unload Me
End Sub

Private Sub Form_Load()
    XPFrame1.BackColor = RGB(198, 229, 211)     '设置背景颜色
    Me.Left = frmMain.Left + (frmMain.Width - Me.Width) / 2     '设置窗体显示位置
    Me.Top = frmMain.Top + (frmMain.Height - Me.Height) / 2     '设置窗体显示位置
End Sub

⌨️ 快捷键说明

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