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

📄 qinshichaxun.frm

📁 带有SQL
💻 FRM
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form qinshichaxun 
   Caption         =   "寝室情况查询"
   ClientHeight    =   5880
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   10245
   LinkTopic       =   "Form1"
   MDIChild        =   -1  'True
   ScaleHeight     =   5880
   ScaleWidth      =   10245
   Begin VB.Frame Frame2 
      Caption         =   "寝室信息列表"
      Height          =   2775
      Left            =   240
      TabIndex        =   5
      Top             =   2760
      Width           =   9735
      Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1 
         Height          =   2175
         Left            =   120
         TabIndex        =   7
         Top             =   360
         Width           =   9495
         _ExtentX        =   16748
         _ExtentY        =   3836
         _Version        =   393216
         Cols            =   12
         FixedCols       =   2
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "查询"
      Height          =   1455
      Left            =   240
      TabIndex        =   0
      Top             =   960
      Width           =   9735
      Begin VB.CommandButton Command1 
         Caption         =   "确定"
         Default         =   -1  'True
         Height          =   375
         Left            =   8160
         TabIndex        =   6
         Top             =   600
         Width           =   855
      End
      Begin VB.TextBox Text2 
         Height          =   375
         Left            =   5520
         TabIndex        =   4
         Top             =   600
         Width           =   1935
      End
      Begin VB.TextBox Text1 
         Height          =   375
         Left            =   1800
         TabIndex        =   2
         Top             =   600
         Width           =   1935
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         Caption         =   "寝 室 号:"
         Height          =   180
         Left            =   4440
         TabIndex        =   3
         Top             =   720
         Width           =   900
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "居住楼号:"
         Height          =   180
         Left            =   600
         TabIndex        =   1
         Top             =   720
         Width           =   900
      End
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      Caption         =   "寝室情况查询"
      BeginProperty Font 
         Name            =   "幼圆"
         Size            =   18
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   360
      Left            =   3840
      TabIndex        =   8
      Top             =   240
      Width           =   2160
   End
End
Attribute VB_Name = "qinshichaxun"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Command1_Click()
          Dim txtSQL As String
     Dim MsgText As String
     Dim mrc As ADODB.Recordset
     '/////////////////////////////////////
    If Trim(Me.Text1.Text = "") Then
        MsgBox "请输入居住楼号", 0, "提示"
        Me.Text1.SetFocus
        Exit Sub
    End If
    
     If Trim(Me.Text2.Text = "") Then
        MsgBox "请输入寝室号", 0, "提示"
        Me.Text2.SetFocus
        Exit Sub
    End If
        txtSQL = "select * from qinshi_if where juzhu_ID = '" & Me.Text1.Text & "'"
        Set mrc = ExecuteSQL(txtSQL, MsgText)
        If mrc.EOF = True Then
            MsgBox "没有这个寝室,请重新输入查找信息!", vbOKOnly + vbExclamation, "警告"
            Me.Text1.Text = ""
            Me.Text1.SetFocus
            Exit Sub
        Else
            
            If Trim(mrc.Fields(0)) = Trim(Me.Text1.Text) Then
    With MSFlexGrid1
        .Rows = 2
        .CellAlignment = 4
       .TextMatrix(0, 0) = "居住楼号"
       .TextMatrix(0, 1) = "寝 室 名"
       .TextMatrix(0, 2) = "居住性别"
       .TextMatrix(0, 3) = "寝室电话"
       .TextMatrix(0, 4) = "价    格"
       .TextMatrix(0, 5) = "应居人数"
       .TextMatrix(0, 6) = "实居人数"
       .TextMatrix(0, 7) = "居住状态"
       .TextMatrix(0, 8) = "所在楼号"
       .TextMatrix(0, 9) = "其它描述"
        
      Do While Not mrc.EOF
          
            .Rows = .Rows + 1
            .CellAlignment = 4
            .TextMatrix(.Rows - 2, 0) = mrc.Fields(0)
             .TextMatrix(.Rows - 2, 1) = mrc.Fields(1)
            ' .TextMatrix(.Rows - 2, 2) = mrc.Fields(2)
            ' .TextMatrix(.Rows - 2, 3) = mrc.Fields(3)
            '.TextMatrix(.Rows - 2, 4) = mrc.Fields(4)
            '.TextMatrix(.Rows - 2, 5) = mrc.Fields(5)
            '.TextMatrix(.Rows - 2, 6) = mrc.Fields(6)
            '.TextMatrix(.Rows - 2, 7) = mrc.Fields(7)
            '.TextMatrix(.Rows - 2, 8) = mrc.Fields(8)
            '.TextMatrix(.Rows - 2, 9) = mrc.Fields(9)
            mrc.MoveNext
            
        Loop
        
    End With
    mrc.Close
    
   End If
  End If
End Sub


Private Sub Form_Load()
    Call loading
End Sub

Private Sub loading()              '定义一个Q寝室信息的字段名在列表里显示出来的函数
       Me.MSFlexGrid1.TextMatrix(0, 0) = "居住楼号"
       Me.MSFlexGrid1.TextMatrix(0, 1) = "寝 室 名"
       Me.MSFlexGrid1.TextMatrix(0, 2) = "居住性别"
       Me.MSFlexGrid1.TextMatrix(0, 3) = "寝室电话"
       Me.MSFlexGrid1.TextMatrix(0, 4) = "价    格"
       Me.MSFlexGrid1.TextMatrix(0, 5) = "应居人数"
       Me.MSFlexGrid1.TextMatrix(0, 6) = "实居人数"
       Me.MSFlexGrid1.TextMatrix(0, 7) = "居住状态"
       Me.MSFlexGrid1.TextMatrix(0, 8) = "所在楼号"
       Me.MSFlexGrid1.TextMatrix(0, 9) = "其它描述"
       Me.Width = 10500
End Sub

⌨️ 快捷键说明

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