cn.Open
End Sub
Private Sub command1_Click()
str1 = "select * from 设备领用登记表='" & Text1.Text & "'"
If rs.State = 1 Then
rs.Close
End If
rs.Open str1, cn, 1, 3
If rs.EOF Then
MsgBox "该设备不存在"
Else
Text1.Text = rs("编号")
Text2.Text = rs("设备名称")
Text3.Text = rs("设备编号")
Text4.Text = rs("领用者")
Text5.Text = rs("领用数量")
Text6.Text = rs("领用部门")
Text7.Text = rs("领用日期")
End If
End Sub
Private Sub Command2_Click()
str1 = "select * from 设备领用登记表 where编号='" & Text1.Text & "'"
If rs.State = 1 Then
rs.Close
End If
rs.Open str1, cn, 1, 3
If rs.EOF Then
rs.AddNew
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, "信息提示"
Else
MsgBox "该设备已经存在", 16, "警告"
End If
End Sub
Private Sub Command3_Click()
str1 = "select * from 设备领用登记表 where编号='" & Text1.Text & "'"
If rs.State = 1 Then
rs.Close
End If
rs.Open str1, cn, 1, 3
If rs.EOF Then
MsgBox "该设备不存在"
Else
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, "特别提示") VB设备管理系统设计+需求分析+可行性分析(19):http://www.youerw.com/jisuanji/lunwen_192.html