📄 f13.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form f13
BackColor = &H00FFC0C0&
Caption = "f13"
ClientHeight = 7950
ClientLeft = 60
ClientTop = 450
ClientWidth = 7830
LinkTopic = "Form1"
ScaleHeight = 7950
ScaleWidth = 7830
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 4680
TabIndex = 13
Top = 6120
Width = 1455
End
Begin VB.TextBox t1
BackColor = &H00E0E0E0&
Height = 375
Left = 2400
TabIndex = 5
Top = 2040
Width = 4335
End
Begin VB.TextBox t2
BackColor = &H00E0E0E0&
Height = 375
Left = 2400
TabIndex = 4
Top = 2760
Width = 4335
End
Begin VB.TextBox t4
BackColor = &H00E0E0E0&
Height = 375
Left = 2400
TabIndex = 3
Top = 3480
Width = 1095
End
Begin VB.TextBox t5
BackColor = &H00E0E0E0&
Height = 375
Left = 2400
TabIndex = 2
Top = 4200
Width = 3375
End
Begin VB.TextBox t6
BackColor = &H00E0E0E0&
Height = 375
Left = 2400
TabIndex = 1
Top = 4920
Width = 2655
End
Begin VB.CommandButton Command1
Caption = "添加"
Height = 375
Left = 2400
TabIndex = 0
Top = 6120
Width = 1575
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 7920
Top = 2040
Width = 1695
_ExtentX = 2990
_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.Label Label1
BackColor = &H00FFC0C0&
Caption = "填写如下信息进行添加"
BeginProperty Font
Name = "幼圆"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2400
TabIndex = 12
Top = 1080
Width = 3735
End
Begin VB.Label Label2
BackColor = &H00FFC0C0&
Caption = "药品名称"
BeginProperty Font
Name = "幼圆"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1080
TabIndex = 11
Top = 2040
Width = 1095
End
Begin VB.Label Label3
BackColor = &H00FFC0C0&
Caption = "生产厂家"
BeginProperty Font
Name = "幼圆"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1080
TabIndex = 10
Top = 4200
Width = 1095
End
Begin VB.Label Label4
BackColor = &H00FFC0C0&
Caption = "功效"
BeginProperty Font
Name = "幼圆"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1560
TabIndex = 9
Top = 2760
Width = 615
End
Begin VB.Label Label5
BackColor = &H00FFC0C0&
Caption = "保质期"
BeginProperty Font
Name = "幼圆"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1320
TabIndex = 8
Top = 3480
Width = 855
End
Begin VB.Label Label6
BackColor = &H00FFC0C0&
Caption = "厂家联系方式"
BeginProperty Font
Name = "幼圆"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 600
TabIndex = 7
Top = 4920
Width = 1575
End
Begin VB.Label Label8
BackColor = &H00FFC0C0&
Caption = "个月"
BeginProperty Font
Name = "幼圆"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3600
TabIndex = 6
Top = 3240
Width = 1095
End
End
Attribute VB_Name = "f13"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim sql As String
If Trim(t1.Text) = "" Then
MsgBox "药名不能为空!", vbOKOnly
Exit Sub
End If
sql = "select * from med where 药名='" & t1 & " '"
Adodc1.RecordSource = sql
Adodc1.Refresh
If Adodc1.Recordset.BOF Then
Else
MsgBox "该药品已存在!", vbOKOnly
Exit Sub
End If
If Trim(t2.Text) = "" Then
MsgBox "功效不能为空!", vbOKOnly
Exit Sub
End If
If Trim(t5.Text) = "" Then
MsgBox "厂商不能为空!", vbOKOnly
Exit Sub
End If
Dim sqlstr As String
sqlstr = "select * from med"
Adodc1.RecordSource = sqlstr
Adodc1.Refresh
Adodc1.Recordset.AddNew
Adodc1.Recordset.Fields("药名") = Trim(t1)
Adodc1.Recordset.Fields("功效") = Trim(t2)
Adodc1.Recordset.Fields("保质期") = Trim(t4)
Adodc1.Recordset.Fields("厂商") = Trim(t5)
Adodc1.Recordset.Fields("厂商联系方式") = Trim(t6)
Adodc1.Recordset.Update
Me.Hide
MsgBox "记录已添加!", vbOKOnly
End Sub
Private Sub t12_Change()
End Sub
Private Sub t13_Change()
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -