📄 start3.frm
字号:
VERSION 5.00
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form start3
Caption = "Form1"
ClientHeight = 2496
ClientLeft = 48
ClientTop = 336
ClientWidth = 3744
LinkTopic = "Form1"
ScaleHeight = 2496
ScaleWidth = 3744
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command3
Caption = "完成"
Height = 372
Left = 2400
TabIndex = 7
Top = 840
Width = 972
End
Begin MSAdodcLib.Adodc Adodc2
Height = 312
Left = 2400
Top = 2160
Visible = 0 'False
Width = 1212
_ExtentX = 2138
_ExtentY = 550
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=Microsoft.Jet.OLEDB.4.0;Data Source=D:\student\teachmanage.mdb;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\student\teachmanage.mdb;Persist Security Info=False"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select kid from course"
Caption = "Adodc2"
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 = 276
Left = 2880
TabIndex = 6
Top = 0
Width = 612
End
Begin MSAdodcLib.Adodc Adodc1
Height = 312
Left = 2400
Top = 2160
Visible = 0 'False
Width = 1092
_ExtentX = 1926
_ExtentY = 550
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\student\teachmanage.mdb;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\student\teachmanage.mdb;Persist Security Info=False"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from student "
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 MSDataListLib.DataList DataList1
Bindings = "start3.frx":0000
DataSource = "Adodc1"
Height = 1884
Left = 360
TabIndex = 4
Top = 480
Width = 1452
_ExtentX = 2561
_ExtentY = 3323
_Version = 393216
ListField = "id"
BoundColumn = "id"
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 372
Left = 2400
TabIndex = 3
Top = 1560
Width = 972
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 372
Left = 2400
TabIndex = 2
Top = 840
Width = 972
End
Begin MSDataListLib.DataCombo DataCombo1
Bindings = "start3.frx":0015
DataSource = "Adodc2"
Height = 300
Left = 1080
TabIndex = 0
Top = 0
Width = 852
_ExtentX = 1503
_ExtentY = 529
_Version = 393216
ListField = "kid"
Text = ""
End
Begin VB.Label Label2
Caption = "学期"
Height = 252
Left = 2160
TabIndex = 5
Top = 0
Width = 492
End
Begin VB.Label Label1
Caption = "课程编号"
Height = 372
Left = 240
TabIndex = 1
Top = 0
Width = 732
End
End
Attribute VB_Name = "start3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim adoprimaryrs As New ADODB.Recordset
Attribute adoprimaryrs.VB_VarHelpID = -1
Dim mbChangedByCode As Boolean
Dim mvBookMark As Variant
Dim mbEditFlag As Boolean
Dim mbAddNewFlag As Boolean
Dim mbDataChanged As Boolean
Private Sub Command1_Click()
Do
If DataCombo1.Text = "" Then
myexit1 = MsgBox("请选择课程编号!", vbOKOnly)
If myexit1 = vbOK Then
Unload Me
End If
Exit Do
End If
If Combo1.Text = "" Then
myexit1 = MsgBox("请选择学期!", vbOKOnly)
If myexit1 = vbOK Then
Unload Me
End If
Exit Do
End If
If DataList1.Text = "" Then
myexit1 = MsgBox("请选择学号!", vbOKOnly)
If myexit1 = vbOK Then
Unload Me
End If
Exit Do
End If
Dim db As Connection
Set db = New Connection
db.CursorLocation = adUseClient
db.Open "PROVIDER=Microsoft.Jet.OLEDB.3.51;Data Source=" & path & "teachmanage.mdb;"
Set adoprimaryrs = New Recordset
l = "select * from score where id='" & Trim(CStr(DataList1.Text)) & " ' and trim(kid)='" & DataCombo1.Text & "'and semester ='" & Combo1.Text & "' and category='选修' Order by id"
adoprimaryrs.Open l, db, adOpenStatic, adLockOptimistic
If adoprimaryrs.RecordCount > 0 Then
myexit = MsgBox("此人本学期此门选修课初始记录已录入!", vbOKOnly)
If myexit = vbOK Then
Unload Me
Exit Do
End If
Else
adoprimaryrs.AddNew
adoprimaryrs("id") = DataList1.Text
adoprimaryrs("kid") = DataCombo1.Text
adoprimaryrs("category") = "选修"
adoprimaryrs("semester") = Combo1.Text
adoprimaryrs.Update
db.Close
Command1.Visible = False
Command3.Visible = True
End If
Loop While myexit1 <> vbOK
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub DataList1_GotFocus()
Command3.Visible = False
Command1.Visible = True
End Sub
Private Sub Form_Load()
Combo1.AddItem "1"
Combo1.AddItem "2"
Combo1.AddItem "3"
Combo1.AddItem "4"
Combo1.AddItem "5"
Combo1.AddItem "6"
Combo1.AddItem "7"
Combo1.AddItem "8"
Command3.Visible = False
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -