📄 frmbooktype.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Begin VB.Form Frmbooktype
Caption = "书籍种类管理"
ClientHeight = 4140
ClientLeft = 60
ClientTop = 465
ClientWidth = 7020
LinkTopic = "Form1"
ScaleHeight = 4140
ScaleWidth = 7020
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command6
Caption = "返 回"
Height = 495
Left = 5640
TabIndex = 12
Top = 3240
Width = 1095
End
Begin VB.CommandButton Command5
Caption = "取 消"
Height = 495
Left = 4560
TabIndex = 11
Top = 3240
Width = 1095
End
Begin VB.CommandButton Command4
Caption = "确 定"
Height = 495
Left = 3480
TabIndex = 10
Top = 3240
Width = 1095
End
Begin VB.CommandButton Command3
Caption = "删 除"
Height = 495
Left = 2400
TabIndex = 9
Top = 3240
Width = 1095
End
Begin VB.CommandButton Command2
Caption = "修 改"
Height = 495
Left = 1320
TabIndex = 8
Top = 3240
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "添 加"
Height = 495
Left = 240
TabIndex = 7
Top = 3240
Width = 1095
End
Begin MSDataListLib.DataList DataList1
Bindings = "Frmbooktype.frx":0000
DataField = "id"
DataSource = "Adodc1"
Height = 2160
Left = 360
TabIndex = 2
Top = 600
Width = 1695
_ExtentX = 2990
_ExtentY = 3810
_Version = 393216
ListField = "id"
End
Begin VB.TextBox Text2
Height = 375
Left = 3360
Locked = -1 'True
TabIndex = 1
Top = 2160
Width = 1815
End
Begin VB.TextBox Text1
Height = 375
Left = 3360
Locked = -1 'True
TabIndex = 0
Top = 1560
Width = 1815
End
Begin MSAdodcLib.Adodc Adodc1
Height = 450
Left = 3840
Top = 360
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 794
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 = $"Frmbooktype.frx":0015
OLEDBString = $"Frmbooktype.frx":00A1
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from book_type"
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.Frame Frame1
Caption = "书籍类别编号"
Height = 2535
Left = 240
TabIndex = 3
Top = 360
Width = 1935
End
Begin VB.Frame Frame2
Caption = "书籍类别"
Height = 1695
Left = 2520
TabIndex = 4
Top = 1080
Width = 3015
Begin VB.Label Label2
Caption = "类别:"
Height = 375
Left = 240
TabIndex = 6
Top = 1080
Width = 615
End
Begin VB.Label Label1
Caption = "编号:"
Height = 375
Left = 240
TabIndex = 5
Top = 480
Width = 735
End
End
Begin VB.Frame Frame3
Height = 975
Left = 120
TabIndex = 13
Top = 3000
Width = 6735
End
End
Attribute VB_Name = "Frmbooktype"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim addcom, modycom, delecom As Boolean
Private Sub File1_Click()
End Sub
Private Sub Command1_Click()
Text1.Text = ""
Text1.SetFocus
Text2.Text = ""
DataList1.Refresh
Adodc1.Refresh
DataList1.ReFill
addcom = True
Command1.Enabled = False
Command2.Enabled = False
Command3.Enabled = False
Command6.Enabled = False
Text1.Locked = False
Text2.Locked = False
End Sub
Private Sub Command2_Click()
modycom = True
Text1.Locked = False
Text2.Locked = False
DataList1.Refresh
Adodc1.Refresh
DataList1.ReFill
Command1.Enabled = False
Command2.Enabled = False
Command3.Enabled = False
Command6.Enabled = False
End Sub
Private Sub Command3_Click()
delecom = True
Command1.Enabled = False
Command2.Enabled = False
Command3.Enabled = False
Command6.Enabled = False
End Sub
Private Sub Command4_Click()
Text1.Locked = True
Text2.Locked = True
If addcom = True Then
addcom = False
cnn2.AddNew
cnn2.Fields(0).Value = Text1.Text
cnn2.Fields(1).Value = Text2.Text
cnn2.Update
MsgBox "添加成功!"
End If
If modycom = True Then
modycom = False
cnn2.Fields(0).Value = Text1.Text
cnn2.Fields(1).Value = Text2.Text
cnn2.Update
MsgBox "修改成功!"
End If
If delecom = True Then
delecom = False
Do While cnn2.EOF = False
If cnn2.EOF = True Then
Exit Do
End If
If DataList1.Text = cnn2.Fields(0) Then
cnn2.Delete
Exit Do
End If
cnn2.MoveNext
Loop
Text1.Text = ""
Text2.Text = ""
MsgBox "删除成功!"
End If
DataList1.Refresh
Adodc1.Refresh
DataList1.ReFill
Command1.Enabled = True
Command2.Enabled = True
Command3.Enabled = True
Command6.Enabled = True
End Sub
Private Sub Command5_Click()
addcom = False
modycom = False
delecom = False
Text1.Locked = True
Text2.Locked = True
Command1.Enabled = True
Command2.Enabled = True
Command3.Enabled = True
Command6.Enabled = True
End Sub
Private Sub Command6_Click()
Unload Me
End Sub
Private Sub DataList1_Click()
Text1.Text = DataList1.Text
cnn2.MoveFirst
Do While cnn2.EOF = False
If cnn2.EOF = True Then
Exit Sub
End If
If DataList1.Text = cnn2.Fields(0).Value Then
Text2.Text = cnn2.Fields(1).Value
Exit Sub
Else
End If
cnn2.MoveNext
Loop
End Sub
Private Sub Form_Load()
Open_book_type
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -