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

📄 查询窗口.frm

📁 可直接打开编辑网络数据库
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmfine 
   Caption         =   "查询"
   ClientHeight    =   1215
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   5925
   Icon            =   "查询窗口.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1215
   ScaleWidth      =   5925
   StartUpPosition =   2  '屏幕中心
   Begin VB.ComboBox Combo1 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   330
      ItemData        =   "查询窗口.frx":0442
      Left            =   1320
      List            =   "查询窗口.frx":0444
      TabIndex        =   5
      Top             =   240
      Width           =   3495
   End
   Begin VB.CommandButton Command2 
      Caption         =   "取消"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   5160
      TabIndex        =   4
      Top             =   720
      Width           =   615
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确定"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   5160
      TabIndex        =   3
      Top             =   240
      Width           =   615
   End
   Begin VB.TextBox Text2 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   350
      Left            =   1320
      TabIndex        =   0
      Top             =   740
      Width           =   3495
   End
   Begin VB.Label Label2 
      Caption         =   "查询关键词:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   120
      TabIndex        =   2
      Top             =   840
      Width           =   1335
   End
   Begin VB.Label Label1 
      Caption         =   "字段名:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   480
      TabIndex        =   1
      Top             =   360
      Width           =   855
   End
End
Attribute VB_Name = "frmfine"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Command1_Click()
Dim sqltxt, stron As String

sqltxt = frmMain.txtSqlStatement.Text
  
  If sqltxt = "" Then
     MsgBox " 应先打开有效数据库......", , "错误!"
     
  ElseIf Combo1.Text = "" Or frmfine.Text2.Text = "" Then
     MsgBox " 输入不正确......", , "错误!"
     Exit Sub
  Else
        stron = " where " & Combo1.Text & " like " & "'%" & Text2.Text & "%'"
         frmMain.txtSqlStatement.Text = sqltxt & stron
        Me.Hide
      ' MsgBox "先 [确定], 再用鼠标点击[SQL 窗口] 后的 [执行] 即等到查询的结果!", , "操作提示!"
        frmMain.cmdExecute_Click
 End If
         MsgBox " Custom SQL表中为查询结果: 共 " & frmMain.adoData.Recordset.RecordCount & " 个记录。", vbOKOnly, "提示"
         Unload Me
End Sub

Private Sub Command2_Click()
   Unload Me
End Sub

Private Sub Form_Load()
Dim nCount As Integer

 If Not frmMain.adoData.Recordset Is Nothing Then
    Combo1.Clear
    With frmMain.adoData.Recordset.Fields
        For nCount = 0 To .Count - 1
            Combo1.AddItem .Item(nCount).Name
        Next nCount
    End With
    If defaultIndex = -1 Then
         Combo1.ListIndex = 0
    ElseIf defaultIndex <= Combo1.ListCount - 1 Then
         Combo1.ListIndex = defaultIndex
    End If
 End If
End Sub



⌨️ 快捷键说明

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