📄 部门信息管理.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 Form6
Caption = "部门信息管理"
ClientHeight = 6375
ClientLeft = 60
ClientTop = 420
ClientWidth = 8835
LinkTopic = "Form6"
ScaleHeight = 6375
ScaleWidth = 8835
StartUpPosition = 3 '窗口缺省
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 6600
Top = 3960
Visible = 0 'False
Width = 1455
_ExtentX = 2566
_ExtentY = 661
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 = "bmxx"
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 VB.Frame Frame1
Caption = "操 作"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1815
Left = 480
TabIndex = 1
Top = 4320
Width = 7815
Begin VB.CommandButton Command5
Caption = "返 回"
Height = 375
Left = 6480
TabIndex = 6
Top = 720
Width = 975
End
Begin VB.CommandButton Command4
Caption = "查 询"
Height = 375
Left = 5040
TabIndex = 5
Top = 720
Width = 975
End
Begin VB.CommandButton Command3
Caption = "删 除"
Height = 375
Left = 3480
TabIndex = 4
Top = 720
Width = 975
End
Begin VB.CommandButton Command2
Caption = "修 改"
Height = 375
Left = 1920
TabIndex = 3
Top = 720
Width = 975
End
Begin VB.CommandButton Command1
Caption = "添 加"
Height = 375
Left = 480
TabIndex = 2
Top = 720
Width = 975
End
End
Begin MSDataGridLib.DataGrid DataGrid1
Height = 3855
Left = 240
TabIndex = 0
Top = 120
Width = 8295
_ExtentX = 14631
_ExtentY = 6800
_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 = "Form6"
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
Form8.Show
End Sub
Private Sub Command2_Click()
Call fillrsinfo
Unload Me
Form13.Show
End Sub
Private Sub Command3_Click()
Call fillrsinfo2
Unload Me
Form14.Show
End Sub
Private Sub Command4_Click()
Unload Me
Form15.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 bmxx.部门号,bmxx.部门名称,bmxx.部门电话,bmxx.部门办公处 from bmxx"
rst.Open strSql, cnn, 1, 1
Set DataGrid1.DataSource = rst
End Sub
Private Sub fillrsinfo()
Form13.Text1.Text = Trim(DataGrid1.Columns("部门号"))
Form13.Text2.Text = Trim(DataGrid1.Columns("部门名称"))
Form13.Text3.Text = Trim(DataGrid1.Columns("部门电话"))
Form13.Text4.Text = Trim(DataGrid1.Columns("部门办公处"))
End Sub
Private Sub fillrsinfo2()
Form14.Text1.Text = Trim(DataGrid1.Columns("部门号"))
Form14.Text2.Text = Trim(DataGrid1.Columns("部门名称"))
Form14.Text3.Text = Trim(DataGrid1.Columns("部门电话"))
Form14.Text4.Text = Trim(DataGrid1.Columns("部门办公处"))
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -