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

📄 员工信息录入.frm

📁 很好的VB加SQL系统,可以实现删除擦看添加等功能
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form2 
   Caption         =   "信息录入"
   ClientHeight    =   7365
   ClientLeft      =   60
   ClientTop       =   435
   ClientWidth     =   9285
   LinkTopic       =   "Form2"
   ScaleHeight     =   7365
   ScaleWidth      =   9285
   StartUpPosition =   3  '窗口缺省
   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            =   5280
      TabIndex        =   26
      Top             =   6360
      Width           =   1935
   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        =   25
      Top             =   6360
      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            =   480
      TabIndex        =   24
      Top             =   6360
      Width           =   1575
   End
   Begin VB.TextBox Text12 
      Height          =   615
      Left            =   7320
      TabIndex        =   23
      Top             =   5280
      Width           =   1815
   End
   Begin VB.TextBox Text11 
      Height          =   615
      Left            =   7320
      TabIndex        =   21
      Top             =   4320
      Width           =   1815
   End
   Begin VB.TextBox Text10 
      Height          =   615
      Left            =   7320
      TabIndex        =   19
      Top             =   3360
      Width           =   1815
   End
   Begin VB.TextBox Text9 
      Height          =   615
      Left            =   7320
      TabIndex        =   17
      Top             =   2400
      Width           =   1815
   End
   Begin VB.TextBox Text8 
      Height          =   615
      Left            =   7320
      TabIndex        =   15
      Top             =   1440
      Width           =   1815
   End
   Begin VB.TextBox Text7 
      Height          =   615
      Left            =   7320
      TabIndex        =   13
      Top             =   480
      Width           =   1815
   End
   Begin VB.TextBox Text6 
      Height          =   615
      Left            =   2760
      TabIndex        =   11
      Top             =   5280
      Width           =   1935
   End
   Begin VB.TextBox Text5 
      Height          =   615
      Left            =   2760
      TabIndex        =   9
      Top             =   4320
      Width           =   1935
   End
   Begin VB.TextBox Text4 
      Height          =   615
      Left            =   2760
      TabIndex        =   7
      Top             =   3360
      Width           =   1935
   End
   Begin VB.TextBox Text3 
      Height          =   615
      Left            =   2760
      TabIndex        =   5
      Top             =   2400
      Width           =   1935
   End
   Begin VB.TextBox Text2 
      Height          =   615
      Left            =   2760
      TabIndex        =   3
      Top             =   1440
      Width           =   1935
   End
   Begin VB.TextBox Text1 
      Height          =   615
      Left            =   2760
      TabIndex        =   1
      Top             =   480
      Width           =   1935
   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            =   4920
      TabIndex        =   22
      Top             =   5400
      Width           =   1935
   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            =   4920
      TabIndex        =   20
      Top             =   4440
      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            =   4920
      TabIndex        =   18
      Top             =   3480
      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            =   4920
      TabIndex        =   16
      Top             =   2520
      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            =   4920
      TabIndex        =   14
      Top             =   1560
      Width           =   2055
   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            =   4920
      TabIndex        =   12
      Top             =   600
      Width           =   2055
   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            =   240
      TabIndex        =   10
      Top             =   5400
      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            =   240
      TabIndex        =   8
      Top             =   4440
      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            =   240
      TabIndex        =   6
      Top             =   3480
      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            =   240
      TabIndex        =   4
      Top             =   2520
      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            =   240
      TabIndex        =   2
      Top             =   1560
      Width           =   2175
   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            =   240
      TabIndex        =   0
      Top             =   600
      Width           =   2175
   End
End
Attribute VB_Name = "Form2"
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 编号 As String
    编号 = Text1.Text
    Dim 姓名 As String
    姓名 = Text2.Text
    Dim 部门 As String
    部门 = Text3.Text
     Dim 性别 As String
    性别 = Text4.Text
    Dim 生日 As String
    生日 = Text5.Text
    Dim 籍贯 As String
    籍贯 = Text6.Text
    Dim 学历 As String
    学历 = Text7.Text
    Dim 专业 As String
    专业 = Text8.Text
     Dim 参加工作时间 As String
    参加工作时间 = Text9.Text
    Dim 入党时间 As String
    入党时间 = Text10.Text
    Dim 职称 As String
    职称 = Text11.Text
    Dim 进入公司时间 As String
    进入公司时间 = Text12.Text
    
    
    
    Dim sqlString As String
  sqlString = "insert 员工基本信息 values ('" & 编号 & "','" & 姓名 & "','" & 部门 & "','" & 性别 & "','" & 生日 & "','" & 籍贯 & "','" & 学历 & "','" & 专业 & "','" & 参加工作时间 & "','" & 入党时间 & "','" & 职称 & "','" & 进入公司时间 & "')"
   
    
    MsgBox sqlString
    
    cnn.Execute sqlString
    
    sqlString = "select * from 员工基本信息"
    
    rs.Open sqlString, cnn
    
    Do While Not rs.EOF
         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 Form2
End Sub


⌨️ 快捷键说明

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