📄 start.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 start
Caption = "Form1"
ClientHeight = 3228
ClientLeft = 48
ClientTop = 336
ClientWidth = 5916
LinkTopic = "Form1"
ScaleHeight = 3228
ScaleWidth = 5916
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command4
Caption = "等待"
Height = 372
Left = 1920
TabIndex = 13
Top = 1800
Width = 972
End
Begin VB.CommandButton Command3
Caption = "完成"
Height = 372
Left = 1920
TabIndex = 12
Top = 1800
Width = 972
End
Begin VB.TextBox Text2
Height = 264
Left = 1800
TabIndex = 10
Top = 600
Width = 612
End
Begin VB.ComboBox Combo1
Height = 276
Left = 4680
TabIndex = 9
Top = 600
Width = 732
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 372
Left = 3360
TabIndex = 8
Top = 1800
Width = 1092
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 372
Left = 1920
TabIndex = 7
Top = 1800
Width = 972
End
Begin MSAdodcLib.Adodc Adodc1
Height = 312
Left = 1320
Top = 2520
Visible = 0 'False
Width = 1332
_ExtentX = 2350
_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 kid from course "
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.DataCombo DataCombo1
Bindings = "start.frx":0000
DataSource = "Adodc1"
Height = 300
Left = 3240
TabIndex = 6
Top = 1080
Width = 972
_ExtentX = 1715
_ExtentY = 529
_Version = 393216
ListField = "kid"
Text = ""
End
Begin VB.TextBox Text3
Height = 264
Left = 3360
TabIndex = 1
Top = 600
Width = 372
End
Begin VB.TextBox Text1
Height = 264
Left = 840
TabIndex = 0
Top = 600
Width = 372
End
Begin VB.Label Label5
Caption = "课程编号"
Height = 372
Left = 1920
TabIndex = 11
Top = 1080
Width = 732
End
Begin VB.Label Label4
Caption = "学期"
Height = 252
Left = 4080
TabIndex = 5
Top = 600
Width = 492
End
Begin VB.Label Label3
Caption = "班"
Height = 252
Left = 2760
TabIndex = 4
Top = 600
Width = 492
End
Begin VB.Label Label2
Caption = "专业"
Height = 252
Left = 1320
TabIndex = 3
Top = 600
Width = 732
End
Begin VB.Label Label1
Caption = "年级"
Height = 252
Left = 240
TabIndex = 2
Top = 600
Width = 372
End
End
Attribute VB_Name = "start"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
myexit1 = "a"
Do
If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Or Combo1.Text = "" Or DataCombo1.Text = "" Then
myexit1 = MsgBox("参数遗漏,请重新确认!", vbOKOnly)
If myexit1 = vbOK Then
Me.Hide
End If
Exit Do
End If
Command4.Visible = True
Command1.Visible = False
Dim t As String
t = CStr(Text1.Text) + CStr(Text2.Text) + CStr(Text3.Text)
Dim db As New ADODB.Connection
db.CursorLocation = adUseClient
db.Open "PROVIDER=Microsoft.Jet.OLEDB.3.51;Data Source=" & path & "teachmanage.mdb;"
Dim rs1 As New ADODB.Recordset
l = "select id from student where id between '" & t & "01' and '" & t & "99'"
rs1.Open l, db, adOpenStatic, adLockOptimistic
If rs1.RecordCount = 0 Then
myexit2 = MsgBox("本班名单未输入!", vbOKOnly)
If myexit2 = vbOK Then
Unload Me
Exit Do
End If
End If
Dim rs3 As New ADODB.Recordset
j = "select * from score where id between '" & t & "01' and '" & t & "99' and kid='" & DataCombo1.Text & "'and category='必修' and semester='" & Combo1.Text & "'"
rs3.Open j, db
If rs3.RecordCount > 0 Then
myexit3 = MsgBox("本班本门课程已初始化!", vbOKOnly)
If myexit3 = vbOK Then
Me.Hide
Exit Do
End If
End If
Dim rs2 As New ADODB.Recordset
rs2.Open "select * from score ", db, adOpenStatic, adLockOptimistic
Do While Not rs1.EOF()
rs2.AddNew
rs2("id") = rs1!id
rs2("kid") = DataCombo1.Text
rs2("category") = "必修"
rs2("semester") = Combo1.Text
rs2.Update
rs1.MoveNext
Loop
Command4.Visible = False
Command3.Visible = True
db.Close
Loop While myexit1 <> "a"
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
Unload Me
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
Command4.Visible = False
'Dim db As New ADODB.Connection
'Dim rs1 As New ADODB.Recordset
' db.CursorLocation = adUseClient
' db.Open "PROVIDER=Microsoft.Jet.OLEDB.3.51;Data Source=" & path & "teachmanage.mdb;"
'rs1.Open "select * from cuouse"
'DataCombo1.DataMember = rs1
'DataCombo1.ListField = kid
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -