Private Sub Fault_Click()
Unload Me
End Sub
删除药品库存信息的代码如下:
Private Sub Cmd_del_Click()
Dim QueName As String
Dim strSQL As String
QueName = Trim(del_que.Text)
If QueName = "" Then
MsgBox "查询内容不能为空", vbOKOnly
Exit Sub
Else
OpenDB
strSQL = "Select * from Drug_info Where Drug_name ='" + QueName + "'"
objRS.Open strSQL, objConn, adOpenDynamic, adLockPessimistic
If objRS.EOF Then
MsgBox "没有所查询的药品", vbOKOnly
objRS.Close
CloseDB
Exit Sub
Else
objRS.Close
strSQL = "Delete from Drug_info Where Drug_name='" + QueName + "'"
objConn.Execute (strSQL)
CloseDB
MsgBox "记录已删除", vbOKOnly
End If
End If
End Sub
Private Sub Cmd_del_que_Click()
Dim QueName As String
Dim strSQL As String
QueName = Trim(del_que.Text)
If QueName = "" Then
MsgBox "查询内容不能为空", vbOKOnly
Exit Sub
Else
OpenDB
strSQL = "Select * from Drug_info Where Drug_name ='" + QueName + "'"
objRS.Open strSQL, objConn, adOpenDynamic, adLockPessimistic
If objRS.EOF Then
MsgBox "没有所查询的药品", vbOKOnly
objRS.Close
CloseDB
Exit Sub
Else
Drug_name.Text = objRS.Fields(1).Value
' Drug_type.Text = objRS.Fields(2).Value
Import_price.Text = Str(objRS.Fields(3).Value)
Export_price.Text = Str(objRS.Fields(4).Value)
' Import_time.Text = Str(objRS.Fields(5).Value)
'Drug_num.Text = Str(objRS.Fields(6).Value)
Prodcom.Text = objRS.Fields(7).Value
'Prodplace.Text = objRS.Fields(8).Value
End If
End If
objRS.Close
CloseDB
End Sub
Private Sub Fault_Click()
Unload Me
End Sub
修改药品库存信息的代码如下:
Private Sub Cmd_upd_Click()
Dim QueName As String
Dim strSQL As String
QueName = Trim(del_que.Text)
If QueName = "" Then
MsgBox "查询内容不能为空", vbOKOnly
Exit Sub
Else
OpenDB
strSQL = "Select * from Drug_info Where Drug_name ='" + QueName + "'"
objRS.Open strSQL, objConn, adOpenDynamic, adLockPessimistic
If objRS.EOF Then
MsgBox "没有所查询的药品", vbOKOnly
objRS.Close
CloseDB
Exit Sub
Else
objRS.Fields(1).Value = Drug_name.Text
objRS.Fields(2).Value = Drug_type.Text
objRS.Fields(3).Value = CDbl(Import_price.Text)
objRS.Fields(4).Value = CDbl(Export_price.Text)
'Import_time.Text = Str(objRS.Fields(6).Value
objRS.Fields(5).Value = CDbl(Drug_num.Text)
objRS.Fields(7).Value = Prodcom.Text
objRS.Fields(7).Value = Prodplace.Text
MsgBox "记录已修改", vbOKOnly
objRS.Update
objRS.Close
CloseDB
End If
End If
End Sub
Private Sub Cmd_upd_que_Click()
Dim QueName As String
Dim strSQL As String
QueName = Trim(del_que.Text)
If QueName = "" Then
MsgBox "查询内容不能为空", vbOKOnly
Exit Sub
Else
OpenDB
strSQL = "Select * from Drug_info Where Drug_name ='" + QueName + "'"
objRS.Open strSQL, objConn, adOpenDynamic, adLockPessimistic
If objRS.EOF Then
MsgBox "没有所查询的药品", vbOKOnly
objRS.Close
CloseDB
Exit Sub
Else
Drug_name.Text = objRS.Fields(1).Value
Drug_type.Text = objRS.Fields(2).Value
Import_price.Text = Str(objRS.Fields(3).Value)
Export_price.Text = Str(objRS.Fields(3).Value)
Import_time.Text = Str(objRS.Fields(5).Value)
Drug_num.Text = Str(objRS.Fields(2).Value)
Prodcom.Text = objRS.Fields(7).Value
Prodplace.Text = objRS.Fields(7).Value
End If
End If
objRS.Close
CloseDB
End Sub
Private Sub Fault_Click()
Unload Me
End Sub
询药品库存信息的代码如下:
Private Sub Cmd_del_Click()
Dim QueName As String
Dim strSQL As String
QueName = Trim(del_que.Text)
If QueName = "" Then
MsgBox "查询内容不能为空", vbOKOnly
Exit Sub
Else
OpenDB
strSQL = "Select * from Drug_info Where Drug_name ='" + QueName + "'"
objRS.Open strSQL, objConn, adOpenDynamic, adLockPessimistic
If objRS.EOF Then
MsgBox "没有所查询的药品", vbOKOnly
objRS.Close
CloseDB
Exit Sub
Else
objRS.Close
strSQL = "Delete from Drug_info Where Drug_name='" + QueName + "'"
objConn.Execute (strSQL)
CloseDB
End If
End If
上一页 [1] [2] [3] [4] [5] [6] [7] 下一页