📄 frmdesertdevice.frm
字号:
VERSION 5.00
Begin VB.Form frmDesertDevice
Caption = "设备报废"
ClientHeight = 1800
ClientLeft = 60
ClientTop = 345
ClientWidth = 3735
LinkTopic = "Form1"
ScaleHeight = 1800
ScaleWidth = 3735
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton cmdCancel
Caption = "返回(&C)"
Height = 375
Left = 1920
TabIndex = 4
Top = 1200
Width = 975
End
Begin VB.CommandButton cmdOK
Caption = "报废(&D)"
Height = 375
Left = 600
TabIndex = 3
Top = 1200
Width = 1095
End
Begin VB.Frame Frame1
Caption = "输入信息"
Height = 855
Left = 120
TabIndex = 0
Top = 120
Width = 3495
Begin VB.TextBox txtDeviceNo
Height = 375
Left = 1320
TabIndex = 2
Text = "Text1"
Top = 240
Width = 1935
End
Begin VB.Label Label1
Caption = "设备编号:"
Height = 255
Left = 240
TabIndex = 1
Top = 360
Width = 975
End
End
End
Attribute VB_Name = "frmDesertDevice"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
Dim conn As ADODB.Connection
'组合得到完成数据修改的SQL语句
sqlStr = "update devices set deserted=true" _
& " where deviceNo='" & Trim(txtDeviceNo.Text) & "'"
On Error GoTo exitSub
Set conn = New ADODB.Connection
conn.Open connStr
'执行SQL语句
conn.Execute sqlStr
MsgBox "编号为:" & txtDeviceNo.Text & "的设备已报废!!"
txtDeviceNo.Text = ""
exitSub:
conn.Close
End Sub
Private Sub Form_Load()
'窗体居中显示
Me.Top = (Screen.Height - Me.Height) \ 2
Me.Left = (Screen.Width - Me.Width) \ 2
txtDeviceNo = ""
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -