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

📄 按职称查询.frm

📁 很好的VB加SQL系统,可以实现删除擦看添加等功能
💻 FRM
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form Form7 
   Caption         =   "按职称查询"
   ClientHeight    =   5040
   ClientLeft      =   60
   ClientTop       =   435
   ClientWidth     =   7695
   LinkTopic       =   "Form7"
   ScaleHeight     =   5040
   ScaleWidth      =   7695
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command3 
      Caption         =   "退出"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   5280
      TabIndex        =   5
      Top             =   3480
      Width           =   1575
   End
   Begin VB.CommandButton Command2 
      Caption         =   "清除"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   5280
      TabIndex        =   4
      Top             =   1800
      Width           =   1575
   End
   Begin VB.CommandButton Command1 
      Caption         =   "查询"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   5280
      TabIndex        =   3
      Top             =   240
      Width           =   1575
   End
   Begin VB.TextBox Text1 
      Height          =   855
      Left            =   2640
      TabIndex        =   1
      Top             =   120
      Width           =   2055
   End
   Begin MSFlexGridLib.MSFlexGrid MSG 
      Height          =   3615
      Left            =   120
      TabIndex        =   2
      Top             =   1320
      Width           =   4575
      _ExtentX        =   8070
      _ExtentY        =   6376
      _Version        =   393216
   End
   Begin VB.Label Label1 
      Caption         =   "请输入职称:"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   240
      TabIndex        =   0
      Top             =   240
      Width           =   2055
   End
End
Attribute VB_Name = "Form7"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
 Dim cnn As ADODB.Connection
    Dim rs As ADODB.Recordset
    
    Set cnn = New ADODB.Connection
    Set rs = New ADODB.Recordset
    
    Dim connectionString As String
    connectionString = "dsn=人事管理;uid=sa;pwd="
    
    cnn.Open connectionString
    
    Dim sqlString As String
    
    sqlString = "select 编号,姓名,性别,部门 from 员工基本信息 where 职称='" & Text1.Text & "'"
   
    rs.Open sqlString, cnn
    
       MSG.Clear
    
    i = 1

    MSG.Cols = 4
    MSG.Rows = 1
    MSG.TextMatrix(0, 0) = "编号"
    MSG.TextMatrix(0, 1) = "姓名"
    MSG.TextMatrix(0, 2) = "性别"
    MSG.TextMatrix(0, 3) = "部门"
   


Do While Not rs.EOF
    MSG.Rows = MSG.Rows + 1
    MSG.TextMatrix(i, 0) = rs.Fields(0)
    MSG.TextMatrix(i, 1) = rs.Fields(1)
    MSG.TextMatrix(i, 2) = rs.Fields(2)
    MSG.TextMatrix(i, 3) = rs.Fields(3)
   
    i = i + 1
    rs.MoveNext
Loop
    
    
    rs.Close
    cnn.Close
End Sub

Private Sub Command2_Click()
Text1.Text = ""
End Sub

Private Sub Command3_Click()
Unload Me
Form1.Show
End Sub

⌨️ 快捷键说明

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