📄 form1.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 Form1
Caption = "使用DataGrid控件录入、修改、删除记录"
ClientHeight = 3585
ClientLeft = 60
ClientTop = 345
ClientWidth = 6945
LinkTopic = "Form1"
ScaleHeight = 3585
ScaleWidth = 6945
StartUpPosition = 1 '所有者中心
Begin VB.Frame Frame1
Height = 2070
Left = 45
TabIndex = 3
Top = 375
Width = 6825
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "Form1.frx":0000
Height = 1845
Left = 60
TabIndex = 5
Top = 165
Width = 6675
_ExtentX = 11774
_ExtentY = 3254
_Version = 393216
AllowUpdate = -1 'True
HeadLines = 1
RowHeight = 15
FormatLocked = -1 'True
AllowAddNew = -1 'True
AllowDelete = -1 'True
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 = 5
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
BeginProperty Column02
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 Column03
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 Column04
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
ColumnWidth = 945.071
EndProperty
BeginProperty Column01
ColumnWidth = 1184.882
EndProperty
BeginProperty Column02
ColumnWidth = 1230.236
EndProperty
BeginProperty Column03
ColumnWidth = 1110.047
EndProperty
BeginProperty Column04
ColumnWidth = 2085.166
EndProperty
EndProperty
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Height = 240
Left = 135
TabIndex = 4
Top = 435
Width = 930
End
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 60
Top = 2505
Width = 6795
_ExtentX = 11986
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
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;Persist Security Info=False;User ID=sa;Initial Catalog=test;Data Source=."
OLEDBString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=test;Data Source=."
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = "sa"
Password = ""
RecordSource = "select * from 部门信息表"
Caption = " 数据浏览"
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 Frame3
Height = 660
Left = 60
TabIndex = 0
Top = 2820
Width = 6840
Begin VB.CommandButton CmdExit
Caption = "退出"
Height = 360
Left = 2580
TabIndex = 1
Top = 210
Width = 1905
End
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "部门信息管理"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 2760
TabIndex = 2
Top = 105
Width = 1515
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
'建立数据源的连接
Adodc1.ConnectionString = "driver={SQL Server};server=.;database=test;uid=sa;pid=;"
'查询所有记录,并按"部门编号"排序
Adodc1.RecordSource = "select * from 部门信息表 order by 部门编号"
Adodc1.Refresh
End Sub
Private Sub CmdExit_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -