📄 frmdel.frm
字号:
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Index = 11
Left = 4800
TabIndex = 6
Top = 840
Width = 1575
End
Begin VB.TextBox txtFields
DataField = "备注"
DataSource = "datPrimaryRS"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Index = 12
Left = 1680
TabIndex = 5
Top = 1320
Width = 8175
End
Begin VB.CheckBox Check1
Caption = "已注销"
DataField = "注销"
DataSource = "datPrimaryRS"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 6600
TabIndex = 4
Top = 840
Width = 1335
End
Begin VB.Label lblLabels
Caption = "使用部门:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 7
Left = 480
TabIndex = 16
Top = 360
Width = 1815
End
Begin VB.Label lblLabels
Caption = "负责人:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 8
Left = 3840
TabIndex = 15
Top = 330
Width = 1815
End
Begin VB.Label lblLabels
Caption = "使用状况:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 9
Left = 6600
TabIndex = 14
Top = 405
Width = 1815
End
Begin VB.Label lblLabels
Caption = "使用年限:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 10
Left = 480
TabIndex = 13
Top = 840
Width = 1815
End
Begin VB.Label lblLabels
Caption = "注销日期:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 11
Left = 3600
TabIndex = 12
Top = 840
Width = 1815
End
Begin VB.Label lblLabels
Caption = "备注:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 12
Left = 960
TabIndex = 11
Top = 1365
Width = 1815
End
End
Begin VB.Frame Frame3
Caption = "附件"
Height = 3255
Left = 120
TabIndex = 0
Top = 4320
Width = 10095
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 240
Top = 2640
Visible = 0 'False
Width = 9825
_ExtentX = 17330
_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 = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
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 MSDataGridLib.DataGrid grdDataGrid
Bindings = "frmDel.frx":0000
Height = 2655
Left = 120
TabIndex = 2
Top = 240
Width = 9705
_ExtentX = 17119
_ExtentY = 4683
_Version = 393216
AllowUpdate = 0 'False
HeadLines = 1
RowHeight = 15
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 = 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
Begin MSAdodcLib.Adodc datPrimaryRS
Align = 2 'Align Bottom
Height = 330
Left = 0
Top = 3930
Width = 11235
_ExtentX = 19817
_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 = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
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
End
Attribute VB_Name = "frmDel"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command4_Click()
Unload Me '卸载窗体
End Sub
Private Sub Form_Load()
datPrimaryRS.ConnectionString = constr '设置同数据库的联结
datPrimaryRS.RecordSource = "select 资产编号,资产分类,资产名称,资产型号,生产单位,购买日期,购买价格,使用部门,负责人,使用状况,使用年限,注销日期,备注,注销 from 资产信息表" '设置数据源
datPrimaryRS.Refresh '更新数据
End Sub
Private Sub Form_Unload(Cancel As Integer)
Screen.MousePointer = vbDefault '设置鼠标
End Sub
Private Sub datPrimaryRS_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
On Error Resume Next
datPrimaryRS.Caption = "设备编号: " & CStr(datPrimaryRS.Recordset.Fields(0))
'更新数据表的内容
Adodc1.ConnectionString = constr
Adodc1.RecordSource = "select 资产编号,附件编号,附件类型,附件名称,附件型号,附件价格,使用状态 from 附件信息表 where 资产编号 like " & Trim(datPrimaryRS.Recordset.Fields(0)) & " Order by 附件编号"
Adodc1.Refresh
End Sub
Private Sub cmdDelete_Click()
On Error GoTo DeleteErr
Dim msg1 As String
Dim msg2 As String
msg1 = MsgBox("删除记录吗?", vbInformation + vbOKCancel, "删除记录")
If msg1 = "1" Then '选择"确定"
msg2 = MsgBox("删除附件记录吗?", vbInformation + vbOKCancel, "删除记录")
With datPrimaryRS.Recordset
.Delete '删除记录
.MoveNext
If .EOF Then .MoveLast
End With
Else
Exit Sub
End If
If msg2 = "1" Then '删除附件记录
Adodc1.Recordset.MoveFirst '移动至首记录
While Not Adodc1.Recordset.EOF
If Adodc1.Recordset.Fields(0) = txtFields(0).Text Then
With Adodc1.Recordset
.Delete '删除记录
.MoveNext
End With
End If
Wend
Else
Exit Sub
End If
Exit Sub
DeleteErr:
MsgBox Err.Description
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -