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

📄 按员工号查询.frm

📁 很好的VB加SQL系统,可以实现删除擦看添加等功能
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form3 
   Caption         =   "信息查询"
   ClientHeight    =   7425
   ClientLeft      =   60
   ClientTop       =   435
   ClientWidth     =   9165
   LinkTopic       =   "Form3"
   ScaleHeight     =   7425
   ScaleWidth      =   9165
   StartUpPosition =   3  '窗口缺省
   Begin VB.TextBox Text1 
      Height          =   615
      Left            =   2640
      TabIndex        =   14
      Top             =   360
      Width           =   1935
   End
   Begin VB.TextBox Text2 
      Height          =   615
      Left            =   2640
      TabIndex        =   13
      Top             =   1320
      Width           =   1935
   End
   Begin VB.TextBox Text3 
      Height          =   615
      Left            =   2640
      TabIndex        =   12
      Top             =   2280
      Width           =   1935
   End
   Begin VB.TextBox Text4 
      Height          =   615
      Left            =   2640
      TabIndex        =   11
      Top             =   3240
      Width           =   1935
   End
   Begin VB.TextBox Text5 
      Height          =   615
      Left            =   2640
      TabIndex        =   10
      Top             =   4200
      Width           =   1935
   End
   Begin VB.TextBox Text6 
      Height          =   615
      Left            =   2640
      TabIndex        =   9
      Top             =   5160
      Width           =   1935
   End
   Begin VB.TextBox Text7 
      Height          =   615
      Left            =   7200
      TabIndex        =   8
      Top             =   360
      Width           =   1815
   End
   Begin VB.TextBox Text8 
      Height          =   615
      Left            =   7200
      TabIndex        =   7
      Top             =   1320
      Width           =   1815
   End
   Begin VB.TextBox Text9 
      Height          =   615
      Left            =   7200
      TabIndex        =   6
      Top             =   2280
      Width           =   1815
   End
   Begin VB.TextBox Text10 
      Height          =   615
      Left            =   7200
      TabIndex        =   5
      Top             =   3240
      Width           =   1815
   End
   Begin VB.TextBox Text11 
      Height          =   615
      Left            =   7200
      TabIndex        =   4
      Top             =   4200
      Width           =   1815
   End
   Begin VB.TextBox Text12 
      Height          =   615
      Left            =   7200
      TabIndex        =   3
      Top             =   5160
      Width           =   1815
   End
   Begin VB.CommandButton Command1 
      Caption         =   "查询"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   360
      TabIndex        =   2
      Top             =   6240
      Width           =   1575
   End
   Begin VB.CommandButton Command2 
      Caption         =   "清除"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   2760
      TabIndex        =   1
      Top             =   6240
      Width           =   1815
   End
   Begin VB.CommandButton Command3 
      Caption         =   "退出"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   5160
      TabIndex        =   0
      Top             =   6240
      Width           =   1935
   End
   Begin VB.Label Label1 
      Caption         =   "编号:"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   120
      TabIndex        =   26
      Top             =   480
      Width           =   2175
   End
   Begin VB.Label Label2 
      Caption         =   "姓名:"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   120
      TabIndex        =   25
      Top             =   1440
      Width           =   2175
   End
   Begin VB.Label Label3 
      Caption         =   "部门:"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   120
      TabIndex        =   24
      Top             =   2400
      Width           =   2175
   End
   Begin VB.Label Label4 
      Caption         =   "性别:"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   120
      TabIndex        =   23
      Top             =   3360
      Width           =   2175
   End
   Begin VB.Label Label5 
      Caption         =   "生日:"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   120
      TabIndex        =   22
      Top             =   4320
      Width           =   2175
   End
   Begin VB.Label Label6 
      Caption         =   "籍贯:"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   120
      TabIndex        =   21
      Top             =   5280
      Width           =   2175
   End
   Begin VB.Label Label7 
      Caption         =   "学历:"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   4800
      TabIndex        =   20
      Top             =   480
      Width           =   2055
   End
   Begin VB.Label Label8 
      Caption         =   "专业:"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   4800
      TabIndex        =   19
      Top             =   1440
      Width           =   2055
   End
   Begin VB.Label Label9 
      Caption         =   "参加工作时间:"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   4800
      TabIndex        =   18
      Top             =   2400
      Width           =   2055
   End
   Begin VB.Label Label10 
      Caption         =   "入党时间:"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   4800
      TabIndex        =   17
      Top             =   3360
      Width           =   2055
   End
   Begin VB.Label Label11 
      Caption         =   "职称:"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   4800
      TabIndex        =   16
      Top             =   4320
      Width           =   2055
   End
   Begin VB.Label Label12 
      Caption         =   "进入公司时间:"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   4800
      TabIndex        =   15
      Top             =   5280
      Width           =   1935
   End
End
Attribute VB_Name = "Form3"
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
    
    Do While Not rs.EOF
        Text1.Text = rs("编号")
        Text2.Text = rs("姓名")
        Text3.Text = rs("部门")
        Text4.Text = rs("性别")
        Text5.Text = rs("生日")
        Text6.Text = rs("籍贯")
        Text7.Text = rs("学历")
        Text8.Text = rs("专业")
        Text9.Text = rs("参加工作时间")
        Text10.Text = rs("入党时间")
        Text11.Text = rs("职称")
        Text12.Text = rs("进入公司时间")
        
         MsgBox rs("编号")
         rs.MoveNext
    Loop
    
    rs.Close
    
    cnn.Close
End Sub

Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""

End Sub

Private Sub Command3_Click()
Visible = False
Form1.Visible = True
Unload Form3
End Sub

⌨️ 快捷键说明

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