If c = vbYes Then
rs.Delete
rs.Update
MsgBox "删除成功, 64, "信息提示"
End If
End If
End Sub
Private Sub Command4_Click()
str1 = "select * from 设备领用登记表 where编号='" & Text1.Text & "'"
If rs.State = 1 Then
rs.Close
End If
rs.Open str1, cn, 1, 3
Text1.Text = rs("编号")
Text2.Text = rs("设备名称")
Text3.Text = rs("设备编号")
Text4.Text = rs("领用者")
Text5.Text = rs("领用数量")
Text6.Text = rs("领用部门")
Text7.Text = rs("领用日期")
c = MsgBox("您确认要修改该记录吗?", 32 + 4, "特别提示")
If c = vbYes Then
rs.Update
End If
End Sub
Private Sub Command5_Click()
str1 = "select * from 设备领用登记表 where编号='" & Text1.Text & "'"
If rs.State = 1 Then
rs.Close
End If
rs.Open str1, cn, 1, 3
rs("编号") = Text1.Text
rs("设备名称") = Text2.Text
rs("设备编号") = Text3.Text
rs("领用者") = Text4.Text
rs("领用数量") = Text5.Text
rs("领用部门") = Text6.Text
rs("领用日期") = Text7.Text
rs.Update
MsgBox "数据修改成功", 64, "信息提示"
End Sub
Private Sub Command6_Click()
主界面.Show
cn.Close
Unload Me
End Sub
设备消耗登记:
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Private Sub Form_Load()
If cn.State = 1 Then
cn.Close
End If
cn.connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & App.Path & "\设备管理系统.mdb;" & "Persist Security Info=False"
cn.Open
End Sub
Private Sub Command1_Click()
str1 = "select * from 设备消耗登记表 where 编号='" & Text1.Text & "'"
If rs.State = 1 Then
rs.Close
End If VB设备管理系统设计+需求分析+可行性分析(20):http://www.751com.cn/jisuanji/lunwen_192.html