📄 员工信息管理.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form Form5
Caption = "员工信息管理"
ClientHeight = 6270
ClientLeft = 60
ClientTop = 420
ClientWidth = 8760
LinkTopic = "Form5"
ScaleHeight = 6270
ScaleWidth = 8760
StartUpPosition = 3 '窗口缺省
Begin VB.Frame Frame1
Caption = "操 作"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1455
Left = 480
TabIndex = 1
Top = 4560
Width = 7815
Begin VB.CommandButton Command5
Caption = "返 回"
Height = 375
Left = 6480
TabIndex = 6
Top = 600
Width = 975
End
Begin VB.CommandButton Command4
Caption = "查 询"
Height = 375
Left = 4920
TabIndex = 5
Top = 600
Width = 975
End
Begin VB.CommandButton Command3
Caption = "删 除"
Height = 375
Left = 3360
TabIndex = 4
Top = 600
Width = 975
End
Begin VB.CommandButton Command2
Caption = "修 改"
Height = 375
Left = 1800
TabIndex = 3
Top = 600
Width = 975
End
Begin VB.CommandButton Command1
Caption = "添 加"
Height = 375
Left = 360
TabIndex = 2
Top = 600
Width = 975
End
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 6480
Top = 4080
Visible = 0 'False
Width = 1815
_ExtentX = 3201
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=renshigl;Data Source=MICROSOF-F93C2C"
OLEDBString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=renshigl;Data Source=MICROSOF-F93C2C"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = "sa"
Password = "123"
RecordSource = "ygxx"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSDataGridLib.DataGrid DataGrid1
Height = 4095
Left = 240
TabIndex = 0
Top = 120
Width = 8295
_ExtentX = 14631
_ExtentY = 7223
_Version = 393216
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
End
Attribute VB_Name = "Form5"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim rst As New ADODB.Recordset '定义Recordset对象
Dim strSql As String
Private Sub Command1_Click()
Unload Me
Form9.Show
End Sub
Private Sub Command2_Click()
'Call fillrsinfo
'If rst.State = adStateOpen Then
' rst.Close
'End If
'strSql = "select ygxx.职工号,ygxx.姓名,ygxx.性别,ygxx.年龄,ygxx.籍贯,ygxx.学历,ygxx.职称,ygxx.家庭地址,ygxx.联系电话 from ygxx"
'rst.Open strSql, cnn, 1, 1
'Set DataGrid1.DataSource = rst
Call fillrsinfo
Form10.Show
Unload Me
End Sub
Private Sub Command3_Click()
Call fillrsinfo2
Unload Me
Form11.Show
End Sub
Private Sub Command4_Click()
Unload Me
Form12.Show
End Sub
Private Sub Command5_Click()
Unload Me
Form3.Show
End Sub
Private Sub Form_Load()
If rst.State = adStateOpen Then
rst.Close
End If
Dim strSql As String
strcon = "Provider=SQLOLEDB.1;Password=123;Persist Security Info=True;User ID=sa;Initial Catalog=renshigl;Data Source=MICROSOF-F93C2C"
Set cnn = New ADODB.Connection '实例化Connection对象
cnn.Open strcon '连接数据库
rst.CursorLocation = adUseClient
Call Info
End Sub
Public Sub Info()
If rst.State = adStateOpen Then
rst.Close
End If
strSql = "select ygxx.职工号,ygxx.姓名,ygxx.性别,ygxx.年龄,ygxx.籍贯,ygxx.学历,ygxx.职称,ygxx.家庭地址,ygxx.联系电话 from ygxx"
rst.Open strSql, cnn, 1, 1
Set DataGrid1.DataSource = rst
End Sub
Private Sub fillrsinfo()
Form10.Text1.Text = Trim(DataGrid1.Columns("职工号"))
Form10.Text2.Text = Trim(DataGrid1.Columns("姓名"))
Form10.Text3.Text = Trim(DataGrid1.Columns("性别"))
Form10.Text4.Text = Trim(DataGrid1.Columns("年龄"))
Form10.Text5.Text = Trim(DataGrid1.Columns("籍贯"))
Form10.Text6.Text = Trim(DataGrid1.Columns("学历"))
Form10.Text7.Text = Trim(DataGrid1.Columns("职称"))
Form10.Text8.Text = Trim(DataGrid1.Columns("家庭地址"))
Form10.Text9.Text = Trim(DataGrid1.Columns("联系电话"))
End Sub
Private Sub fillrsinfo2()
Form11.Text1.Text = Trim(DataGrid1.Columns("职工号"))
Form11.Text2.Text = Trim(DataGrid1.Columns("姓名"))
Form11.Text3.Text = Trim(DataGrid1.Columns("性别"))
Form11.Text4.Text = Trim(DataGrid1.Columns("年龄"))
Form11.Text5.Text = Trim(DataGrid1.Columns("籍贯"))
Form11.Text6.Text = Trim(DataGrid1.Columns("学历"))
Form11.Text7.Text = Trim(DataGrid1.Columns("职称"))
Form11.Text8.Text = Trim(DataGrid1.Columns("家庭地址"))
Form11.Text9.Text = Trim(DataGrid1.Columns("联系电话"))
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -