📄 frmforsc.frm
字号:
VERSION 5.00
Begin VB.Form frmForC
Caption = "frmForC"
ClientHeight = 4485
ClientLeft = 4380
ClientTop = 2250
ClientWidth = 6390
LinkTopic = "Form1"
ScaleHeight = 4485
ScaleWidth = 6390
Begin VB.CommandButton cmdWantAdd
Caption = "我要添加"
Height = 495
Left = 480
TabIndex = 11
Top = 3960
Width = 1215
End
Begin VB.CommandButton cmdWantAlter
Caption = "我要修改"
Height = 495
Left = 1920
TabIndex = 10
Top = 3960
Width = 1215
End
Begin VB.CommandButton cmdSelect
Caption = "查找课程"
Height = 495
Left = 3720
TabIndex = 9
Top = 600
Width = 1215
End
Begin VB.CommandButton cmdDel
Caption = "删除课程"
Height = 495
Left = 3360
TabIndex = 8
Top = 3480
Width = 1215
End
Begin VB.CommandButton cmdAlter
Caption = "修改课程"
Height = 495
Left = 1920
TabIndex = 7
Top = 3480
Width = 1215
End
Begin VB.CommandButton cmdAdd
Caption = "增加课程"
Height = 495
Left = 480
TabIndex = 6
Top = 3480
Width = 1215
End
Begin VB.TextBox txtCcredit
Height = 495
Left = 2160
TabIndex = 5
Top = 2640
Width = 1215
End
Begin VB.TextBox txtCname
Height = 495
Left = 2160
TabIndex = 4
Top = 1680
Width = 1215
End
Begin VB.TextBox txtCno
Height = 495
Left = 2160
TabIndex = 1
Top = 600
Width = 1215
End
Begin VB.Label Label2
Caption = "学分"
Height = 495
Left = 720
TabIndex = 3
Top = 2520
Width = 1335
End
Begin VB.Label Label1
Caption = "课程名称"
Height = 615
Left = 720
TabIndex = 2
Top = 1560
Width = 975
End
Begin VB.Label h
Caption = "课程号"
Height = 495
Left = 720
TabIndex = 0
Top = 600
Width = 1215
End
End
Attribute VB_Name = "frmForC"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdAdd_Click()
Dim sql As String
sql = "insert into course(cno,cname,ccredit) values('" & txtCno.Text & "','" & txtCname.Text & "','" & txtCcredit.Text & "');"
cn.Execute sql
MsgBox "添加成功!"
txtCno.Text = ""
txtCname = ""
txtCcredit.Text = ""
End Sub
Private Sub cmdAlter_Click()
Dim sql As String
sql = "update course set cname='" & txtCname.Text & "',ccredit='" & txtCcredit.Text & "';"
cn.Execute sql
End Sub
Private Sub cmdDel_Click()
Dim sql As String
sql = "delete from course where cno='" & txtCno & "';"
cn.Execute sql
MsgBox "记录已删除!"
frmHome.Show
End Sub
Private Sub cmdSelect_Click()
Dim sql As String
Dim rst As New ADODB.Recordset
sql = "select * from course where cno='" & txtCno.Text & "';"
rst.Open sql, cn, adOpenStatic
txtCno.Text = rst!Cno
txtCname.Text = rst!cname
txtCcredit.Text = rst!ccredit
End Sub
Private Sub cmdWantAdd_Click()
txtCno.Text = ""
txtCname = ""
txtCcredit.Text = ""
End Sub
Private Sub cmdWantAlter_Click()
txtCno.Enabled = False
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -