【VB开源代码栏目提醒】:网学会员为广大网友收集整理了,device_delete.frm,希望对大家有所帮助!
VERSION 5.00
Begin VB.Form device_delete
Caption = "设备报废"
ClientHeight = 5415
ClientLeft = 60
ClientTop = 345
ClientWidth = 7425
LinkTopic = "Form1"
ScaleHeight = 5415
ScaleWidth = 7425
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command3
Caption = "取消"
Height = 495
Left = 4200
TabIndex = 22
Top = 4440
Width = 975
End
Begin VB.CommandButton Command2
Caption = "报废"
Height = 495
Left = 2040
TabIndex = 21
Top = 4440
Width = 975
End
Begin VB.TextBox Text7
Enabled = 0 'False
Height = 375
Left = 1560
TabIndex = 9
Top = 3720
Width = 2175
End
Begin VB.TextBox Text8
Enabled = 0 'False
Height = 375
Left = 5520
TabIndex = 8
Top = 720
Width = 1695
End
Begin VB.TextBox Text5
Enabled = 0 'False
Height = 375
Left = 1560
TabIndex = 7
Top = 3000
Width = 2175
End
Begin VB.TextBox Text4
Enabled = 0 'False
Height = 375
Left = 5400
TabIndex = 6
Top = 2400
Width = 1815
End
Begin VB.TextBox Text3
Enabled = 0 'False
Height = 375
Left = 1560
TabIndex = 5
Top = 720
Width = 2295
End
Begin VB.TextBox Text2
Enabled = 0 'False
Height = 375
Left = 1560
TabIndex = 4
Top = 2400
Width = 1095
End
Begin VB.TextBox Text1
Height = 375
Left = 3000
TabIndex = 3
Top = 120
Width = 2295
End
Begin VB.TextBox Text6
Enabled = 0 'False
Height = 375
Left = 1560
TabIndex = 2
Top = 1320
Width = 2295
End
Begin VB.TextBox Text9
Enabled = 0 'False
Height = 375
Left = 1560
TabIndex = 1
Top = 1800
Width = 2295
End
Begin VB.CommandButton Command1
Caption = "确认"
Height = 375
Left = 5880
TabIndex = 0
Top = 120
Width = 975
End
Begin VB.Label Label8
Caption = "进库日期:"
Height = 375
Left = 240
TabIndex = 20
Top = 3720
Width = 1095
End
Begin VB.Label Label10
Caption = "所属系部:"
Height = 375
Left = 240
TabIndex = 19
Top = 1920
Width = 1215
End
Begin VB.Label Label9
Caption = "型号:"
Height = 375
Left = 4680
TabIndex = 18
Top = 720
Width = 1095
End
Begin VB.Label Label6
Caption = "价格:"
Height = 375
Left = 4680
TabIndex = 17
Top = 2400
Width = 1095
End
Begin VB.Label Label5
Caption = "购买日期:"
Height = 375
Left = 240
TabIndex = 16
Top = 3120
Width = 1095
End
Begin VB.Label Label4
Caption = "折旧率:"
Height = 375
Left = 240
TabIndex = 15
Top = 2520
Width = 855
End
Begin VB.Label Label3
Caption = "名称"
Height = 375
Left = 240
TabIndex = 14
Top = 720
Width = 1095
End
Begin VB.Label Label1
Caption = "设备编号:"
Height = 375
Left = 1680
TabIndex = 13
Top = 120
Width = 1095
End
Begin VB.Label Label2
Caption = "类别:"
Height = 375
Left = 240
TabIndex = 12
Top = 1320
Width = 1215
End
Begin VB.Label Label7
Caption = "目前状态:"
Height = 375
Left = 4440
TabIndex = 11
Top = 3720
Width = 1575
End
Begin VB.Label Label11
ForeColor = &H000000FF&
Height = 375
Left = 6240
TabIndex = 10
Top = 3720
Width = 735
End
End
Attribute VB_Name = "device_delete"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & App.Path & "\file.mdb;Persist Security Info=False"
sql = "select * from info_device where dno='" & Text1.Text & "'"
rs.Open sql, cn, 1, 1
If rs.EOF = True Then
MsgBox "没有找到该设备编号"
Else
Text3.Text = rs("dname")
Text8.Text = rs("dmodule")
Text6.Text = rs("dtype")
Text9.Text = rs("ddept")
Text2.Text = rs("dzj")
Text4.Text = rs("dprice")
Text5.Text = rs("dbdate")
Text7.Text = rs("ddate")
If rs("dflag") = 1 Then
Label11.Caption = "在库"
Else
Label11.Caption = "不在库"
End If
End If
End Sub
Private Sub Command2_Click()
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & App.Path & "\file.mdb;Persist Security Info=False"
sql = "select * from info_device where dno='" & Text1.Text & "'"
rs.Open sql, cn, 3, 2
response = MsgBox("确定要报废该设备吗?", vbOKCancel + 32, "提示")
If response = vbOK Then
rs("dbflag") = 1
rs.Update
MsgBox "报废成功"
End If
End Sub
上一篇:
CtrlBitmapButton.cpp
下一篇:
电咖汽车入选2018独角兽企业榜百强 发布“天际”品牌将推高估值