📄 f14.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form f14
BackColor = &H00FFC0C0&
Caption = "f14"
ClientHeight = 4020
ClientLeft = 60
ClientTop = 450
ClientWidth = 8940
LinkTopic = "f14"
ScaleHeight = 4020
ScaleWidth = 8940
StartUpPosition = 3 '窗口缺省
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 9360
Top = 1080
Width = 1455
_ExtentX = 2566
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=MSDASQL.1;Password=19871111;Persist Security Info=True;User ID=sa;Data Source=medicine"
OLEDBString = "Provider=MSDASQL.1;Password=19871111;Persist Security Info=True;User ID=sa;Data Source=medicine"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.ComboBox Combo1
Height = 300
Left = 600
TabIndex = 3
Text = "请选择删除项目"
Top = 1080
Width = 2895
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 6000
TabIndex = 2
Top = 3120
Width = 1935
End
Begin VB.CommandButton C1
Caption = "确认"
Height = 375
Left = 6000
TabIndex = 1
Top = 2280
Width = 1935
End
Begin VB.TextBox t1
BackColor = &H00E0E0E0&
Height = 375
Left = 4680
TabIndex = 0
Top = 1080
Width = 3255
End
End
Attribute VB_Name = "f14"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub C1_Click()
Dim sql As String
If Combo1.Text = "请选择删除项目" Then
MsgBox "请选择删除项目!", vbOKOnly
Exit Sub
End If
If Trim(t1.Text) = "" Then
MsgBox "删除内容不能为空!", vbOKOnly
Exit Sub
End If
If Combo1.Text = "按照药品名删除" Then
sql = "SELECT * FROM med WHERE 药名='" & t1 & " '"
Adodc1.RecordSource = sql
Adodc1.Refresh
If Adodc1.Recordset.BOF Then
MsgBox "该药品不存在!", vbOKOnly
Exit Sub
Else
Adodc1.Recordset.Delete
Adodc1.Recordset.MoveNext
Me.Hide
MsgBox "该库存药品已删除!", vbOKOnly
End If
End If
If Combo1.Text = "按照功效删除" Then
sql = "SELECT * FROM med WHERE 功效='" & t1 & " '"
Adodc1.RecordSource = sql
Adodc1.Refresh
If Adodc1.Recordset.BOF Then
MsgBox "该项功效不存在!", vbOKOnly
Exit Sub
Else
Adodc1.Recordset.Delete
Adodc1.Recordset.MoveNext
Me.Hide
MsgBox "该类药品已删除!", vbOKOnly
End If
End If
If Combo1.Text = "按照厂商删除" Then
sql = "SELECT * FROM med WHERE 厂商='" & t1 & " '"
Adodc1.RecordSource = sql
Adodc1.Refresh
If Adodc1.Recordset.BOF Then
MsgBox "该项厂商生产的药品不存在!", vbOKOnly
Exit Sub
Else
Adodc1.Recordset.Delete
Adodc1.Recordset.MoveNext
Me.Hide
MsgBox "该类药品已删除!", vbOKOnly
End If
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Combo1.AddItem "按照药品名删除"
Combo1.AddItem "按照功效删除"
Combo1.AddItem "按照厂商删除"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -