📄 fmkbset.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 Fmkbset
Caption = "考勤类别"
ClientHeight = 4305
ClientLeft = 60
ClientTop = 345
ClientWidth = 5745
LinkTopic = "Form2"
ScaleHeight = 4305
ScaleWidth = 5745
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Cmdaction
Caption = "删除"
Height = 375
Index = 1
Left = 4440
TabIndex = 5
Top = 960
Width = 735
End
Begin VB.CommandButton Cmdaction
Caption = "刷新"
Height = 375
Index = 2
Left = 4440
TabIndex = 4
Top = 1440
Width = 735
End
Begin VB.CommandButton Cmdaction
Caption = "更新"
Enabled = 0 'False
Height = 375
Index = 3
Left = 4440
TabIndex = 3
Top = 1920
Width = 735
End
Begin VB.CommandButton Cmdaction
Caption = "取消"
Height = 375
Index = 4
Left = 4440
TabIndex = 2
Top = 2400
Width = 735
End
Begin VB.CommandButton Cmdaction
Caption = "增加"
Height = 375
Index = 0
Left = 4440
TabIndex = 1
Top = 480
Width = 735
End
Begin VB.CommandButton Command1
Caption = "返回"
Height = 375
Left = 4440
TabIndex = 0
Top = 2880
Width = 735
End
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "Fmkbset.frx":0000
Height = 3375
Left = 840
TabIndex = 6
Top = 240
Width = 3135
_ExtentX = 5530
_ExtentY = 5953
_Version = 393216
HeadLines = 1
RowHeight = 15
FormatLocked = -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 = 3
BeginProperty Column00
DataField = "kqlid"
Caption = "kqlid"
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 = "kqlname"
Caption = "kqlname"
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 = "dj"
Caption = "dj"
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 = 734.74
EndProperty
BeginProperty Column01
ColumnWidth = 1005.165
EndProperty
BeginProperty Column02
ColumnWidth = 734.74
EndProperty
EndProperty
End
Begin MSAdodcLib.Adodc Adcjob
Height = 375
Left = 840
Top = 3840
Visible = 0 'False
Width = 2175
_ExtentX = 3836
_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;Persist Security Info=False;User ID=sa;Initial Catalog=hgrs;Data Source=SERVER"
OLEDBString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=hgrs;Data Source=SERVER"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "kbset"
Caption = "Adcjob"
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
End
Attribute VB_Name = "Fmkbset"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim vbookmark As Variant
Dim lcurrrec As Long
Dim baddnewflag As Boolean
Dim WithEvents adors As Recordset
Attribute adors.VB_VarHelpID = -1
Private Sub Cmdaction_Click(Index As Integer)
Dim response
With adors
Select Case Index
Case 0
If Not (.BOF And .EOF) Then
vbookmark = .Bookmark
End If
.AddNew
baddnewflag = True
setbuttons False
Cmdaction(3).Enabled = True
Case 1
response = MsgBox("Are you sure", vbYesNo, "delete record")
If response = vbYes Then
.Delete
.MoveNext
End If
If .EOF Then
lcurrrec = .RecordCount
.MoveLast
End If
Case 2
Dim vmbmid, vmbmname As String
.Requery
Cmdaction(3).Enabled = False
Case 3
response = MsgBox("你确信要更新", vbYesNo, "更新数据")
If response = vbYes Then
.update
lcurrrec = .RecordCount
.MoveLast
End If
setbuttons True
Cmdaction(3).Enabled = False
Case 4
response = MsgBox("你确信取消操作", vbYesNo, "取消操作")
If response = vbYes Then
setbuttons True
.CancelUpdate
If vbookmark > 0 Then
.Bookmark = vbookmark
Else
lcurrrec = 1
.MoveFirst
End If
Cmdaction(3).Enabled = False
baddnewflag = False
End If
End Select
End With
End Sub
Private Sub setbuttons(bval As Boolean)
Cmdaction(0).Enabled = bval
Cmdaction(1).Enabled = bval
Cmdaction(2).Enabled = bval
End Sub
Private Sub Command1_Click()
Dim iresponse As Integer
If Cmdaction(3).Enabled Then
iresponse = MsgBox("data changed ,save it?", vbYesNo, "update data?")
If iresponse = vbYes Then
adors.UpdateBatch adAffectAll
Else
adors.CancelUpdate
End If
End If
adors.Close
Unload Me
End Sub
Private Sub Form_Load()
Set adors = Adcjob.Recordset
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -