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

📄 frminfo.frm

📁 一个实用的学生宿舍管理系统
💻 FRM
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Object = "{E95A2510-F3D1-416D-823B-4F840FE98091}#3.0#0"; "Command.ocx"
Begin VB.Form frminfo 
   Caption         =   "信息查询"
   ClientHeight    =   3075
   ClientLeft      =   60
   ClientTop       =   465
   ClientWidth     =   4680
   Icon            =   "frminfo.frx":0000
   LinkTopic       =   "Form1"
   MDIChild        =   -1  'True
   ScaleHeight     =   3075
   ScaleWidth      =   4680
   Begin MSFlexGridLib.MSFlexGrid MSFlexGrid2 
      Height          =   2895
      Left            =   4440
      TabIndex        =   16
      Top             =   5280
      Width           =   6735
      _ExtentX        =   11880
      _ExtentY        =   5106
      _Version        =   393216
      Cols            =   8
   End
   Begin CSCommand.Command Command1 
      Height          =   495
      Left            =   6960
      TabIndex        =   2
      Top             =   8280
      Width           =   1695
      _ExtentX        =   2990
      _ExtentY        =   873
      IconAlign       =   0
      Icon            =   "frminfo.frx":17B2
      Caption         =   "房间查询"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin VB.Frame Frame2 
      Caption         =   "房间查询"
      Height          =   3735
      Left            =   360
      TabIndex        =   1
      Top             =   5160
      Width           =   3855
      Begin VB.TextBox Text4 
         Height          =   615
         Left            =   720
         TabIndex        =   14
         Text            =   " "
         Top             =   2640
         Width           =   2055
      End
      Begin VB.ComboBox Combo1 
         Height          =   315
         Left            =   480
         TabIndex        =   11
         Text            =   " "
         Top             =   1080
         Width           =   2655
      End
      Begin VB.Label Label3 
         Caption         =   "请输入相应信息:"
         Height          =   495
         Left            =   480
         TabIndex        =   13
         Top             =   2040
         Width           =   2655
      End
      Begin VB.Label Label2 
         Caption         =   "选择查询方式:"
         Height          =   495
         Left            =   480
         TabIndex        =   12
         Top             =   480
         Width           =   2655
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "人物查询"
      Height          =   4455
      Left            =   360
      TabIndex        =   0
      Top             =   480
      Width           =   10815
      Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1 
         Height          =   3975
         Left            =   4080
         TabIndex        =   15
         Top             =   240
         Width           =   6375
         _ExtentX        =   11245
         _ExtentY        =   7011
         _Version        =   393216
         Cols            =   7
      End
      Begin CSCommand.Command Command3 
         Height          =   495
         Left            =   1440
         TabIndex        =   7
         Top             =   3720
         Width           =   1695
         _ExtentX        =   2990
         _ExtentY        =   873
         IconAlign       =   0
         Icon            =   "frminfo.frx":17CE
         Caption         =   "查询"
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
      End
      Begin VB.TextBox Text3 
         Height          =   495
         Left            =   1440
         TabIndex        =   6
         Text            =   " "
         Top             =   2880
         Width           =   1695
      End
      Begin VB.TextBox Text2 
         Height          =   495
         Left            =   1440
         TabIndex        =   5
         Text            =   " "
         Top             =   2040
         Width           =   1695
      End
      Begin VB.TextBox Text1 
         Height          =   495
         Left            =   1440
         TabIndex        =   4
         Text            =   " "
         Top             =   1200
         Width           =   1695
      End
      Begin CSCommand.Command Command2 
         Height          =   495
         Left            =   1440
         TabIndex        =   3
         Top             =   360
         Width           =   1695
         _ExtentX        =   2990
         _ExtentY        =   873
         IconAlign       =   0
         Icon            =   "frminfo.frx":17EA
         Caption         =   "整体查询"
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
      End
      Begin VB.Label Label1 
         Caption         =   "房间:"
         Height          =   495
         Index           =   2
         Left            =   480
         TabIndex        =   10
         Top             =   2880
         Width           =   855
      End
      Begin VB.Label Label1 
         Caption         =   "性别:"
         Height          =   495
         Index           =   1
         Left            =   480
         TabIndex        =   9
         Top             =   2040
         Width           =   855
      End
      Begin VB.Label Label1 
         Caption         =   "姓名:"
         Height          =   495
         Index           =   0
         Left            =   480
         TabIndex        =   8
         Top             =   1200
         Width           =   855
      End
   End
End
Attribute VB_Name = "frminfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim mrc As ADODB.Recordset
Dim MsgText As String
Dim tSQL As String
Private Sub ShowDataS()
    Dim txSQL As String
    Dim mrcc As ADODB.Recordset
    txSQL = "select * from student_Form"
    Set mrcc = ExecuteSQL(txSQL, MsgText)
        With MSFlexGrid1
        .ColWidth(0) = 1200
        .ColWidth(1) = 1200
        .ColWidth(2) = 1200
        .ColWidth(3) = 1200
         .ColWidth(4) = 1200
          .ColWidth(5) = 1200
           .ColWidth(6) = 1200
        .TextMatrix(0, 0) = "姓名"
        .TextMatrix(0, 1) = "性别"
        .TextMatrix(0, 2) = "房间"
        .TextMatrix(0, 3) = "学号"
          .TextMatrix(0, 4) = "班级"
            .TextMatrix(0, 5) = "手机"
              .TextMatrix(0, 6) = "入住日期"
        .Rows = 1
'        Do While Not mrcc.EOF
'            .Rows = .Rows + 1
'            For i = 0 To mrcc.Fields.Count - 1
'                .TextMatrix(.Rows - 1, i) = mrcc.Fields(i) & ""
'            Next i
'            mrcc.MoveNext
'        Loop
    End With
    mrcc.Close
End Sub
Private Sub ShowDataR()
    Dim txSQL As String
    Dim mrcc As ADODB.Recordset
    txSQL = "select * from room_Form"
    Set mrcc = ExecuteSQL(txSQL, MsgText)
        With MSFlexGrid2
        .ColWidth(0) = 1200
        .ColWidth(1) = 1200
        .ColWidth(2) = 1200
        .ColWidth(3) = 1200
         .ColWidth(4) = 1200
          .ColWidth(5) = 1200
           .ColWidth(6) = 1200
            .ColWidth(7) = 1200
        .TextMatrix(0, 0) = "房间号码"
        .TextMatrix(0, 1) = "入住性别"
        .TextMatrix(0, 2) = "电话号码"
        .TextMatrix(0, 3) = "电话端口"
          .TextMatrix(0, 4) = "网线端口"
            .TextMatrix(0, 5) = "可住人数"
              .TextMatrix(0, 6) = "水表底数"
              .TextMatrix(0, 7) = "电表底数"
        .Rows = 1
'        Do While Not mrcc.EOF
'            .Rows = .Rows + 1
'            For i = 0 To mrcc.Fields.Count - 1
'                .TextMatrix(.Rows - 1, i) = mrcc.Fields(i) & ""
'            Next i
'            mrcc.MoveNext
'        Loop
    End With
    mrcc.Close
End Sub
  

Private Sub Command1_Click()
Dim txtSQL As String
     Select Case Trim(Combo1)
     Case "房间号码"
     
       txtSQL = "select * from room_Form where room_NO='" & Trim(Text4) & "' "
    Set mrc = ExecuteSQL(txtSQL, MsgText)
     Case "电话号码"
     
       txtSQL = "select * from room_Form where room_Tel='" & Trim(Text4) & "' "
    Set mrc = ExecuteSQL(txtSQL, MsgText)
     Case "电话端口"
     
       txtSQL = "select * from room_Form where room_TelPort='" & Trim(Text4) & "' "
    Set mrc = ExecuteSQL(txtSQL, MsgText)
     Case "网线端口"
     
       txtSQL = "select * from room_Form where room_NetPort='" & Trim(Text4) & "' "
    Set mrc = ExecuteSQL(txtSQL, MsgText)
    Case Else
     MsgBox "您输入的信息不存在!", vbOKOnly, "提示"
     End Select
  ShowDataR
    With MSFlexGrid2
 Do While Not mrc.EOF
            .Rows = .Rows + 1
            For i = 0 To mrc.Fields.Count - 1
                .TextMatrix(.Rows - 1, i) = mrc.Fields(i) & ""
            Next i
            mrc.MoveNext
        Loop
        End With
End Sub

Private Sub Command2_Click()
 Dim txSQL As String
    Dim mrcc As ADODB.Recordset
    txSQL = "select * from student_Form"
    Set mrcc = ExecuteSQL(txSQL, MsgText)
ShowDataS
With MSFlexGrid1
 Do While Not mrcc.EOF
            .Rows = .Rows + 1
            For i = 0 To mrcc.Fields.Count - 1
                .TextMatrix(.Rows - 1, i) = mrcc.Fields(i) & ""
            Next i
            mrcc.MoveNext
        Loop
        End With
End Sub

Private Sub Command3_Click()
   Dim txtSQL As String
   
   
    txtSQL = "select * from student_Form where student_Name='" & Trim(Text1) & "' or student_Sex='" & Trim(Text2) & "' or student_room='" & Trim(Text3) & "'"
    Set mrc = ExecuteSQL(txtSQL, MsgText)
   'mrc.Update
    'mrc.Close
    ShowDataS
    With MSFlexGrid1
 Do While Not mrc.EOF
            .Rows = .Rows + 1
            For i = 0 To mrc.Fields.Count - 1
                .TextMatrix(.Rows - 1, i) = mrc.Fields(i) & ""
            Next i
            mrc.MoveNext
        Loop
        End With
End Sub

Private Sub Form_Load()
With Combo1
.AddItem "房间号码"
.AddItem "电话号码"
.AddItem "电话端口"
.AddItem "网线端口"
End With
End Sub

⌨️ 快捷键说明

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