📄 frmrelationlesson.frm
字号:
VERSION 5.00
Object = "{D27CDB6B-AE6D-11CF-96B8-444553540000}#1.0#0"; "Flash8a.ocx"
Begin VB.Form frmrelationlesson
BackColor = &H00FFFFFF&
Caption = "专业与课程关系"
ClientHeight = 8145
ClientLeft = 60
ClientTop = 450
ClientWidth = 8685
LinkTopic = "Form1"
ScaleHeight = 8145
ScaleWidth = 8685
Begin VB.ComboBox cobsp
Height = 300
Left = 1320
TabIndex = 7
Text = "cobsp"
Top = 1680
Width = 2295
End
Begin VB.Frame Frame1
BackColor = &H00FFFFFF&
Caption = "Frame1"
Height = 6015
Left = 120
TabIndex = 5
Top = 2040
Width = 3495
Begin VB.ListBox List1
Height = 5460
Left = 240
TabIndex = 6
Top = 360
Width = 3015
End
End
Begin VB.CommandButton Command1
Caption = "课程->专业"
Height = 375
Left = 7440
TabIndex = 4
Top = 6720
Width = 1095
End
Begin VB.CommandButton Command2
Caption = "专业->课程"
Height = 375
Left = 7440
TabIndex = 3
Top = 7200
Width = 1095
End
Begin VB.Frame Frame2
BackColor = &H00FFFFFF&
Caption = "课程"
Height = 6015
Left = 3720
TabIndex = 1
Top = 2040
Width = 3495
Begin VB.ListBox List2
Height = 5460
Left = 240
TabIndex = 2
Top = 360
Width = 3015
End
End
Begin VB.CommandButton Command3
Caption = "确定"
Height = 375
Left = 7440
TabIndex = 0
Top = 7680
Width = 1095
End
Begin ShockwaveFlashObjectsCtl.ShockwaveFlash ShockwaveFlash1
Height = 1575
Left = 1440
TabIndex = 9
Top = 0
Width = 5655
_cx = 9975
_cy = 2778
FlashVars = ""
Movie = ""
Src = ""
WMode = "Window"
Play = -1 'True
Loop = -1 'True
Quality = "High"
SAlign = ""
Menu = -1 'True
Base = ""
AllowScriptAccess= ""
Scale = "ShowAll"
DeviceFont = 0 'False
EmbedMovie = 0 'False
BGColor = ""
SWRemote = ""
MovieData = ""
SeamlessTabbing = -1 'True
Profile = 0 'False
ProfileAddress = ""
ProfilePort = 0
End
Begin VB.Label Label1
BackColor = &H00FFFFFF&
Caption = "请选择专业:"
Height = 255
Left = 120
TabIndex = 8
Top = 1695
Width = 1095
End
End
Attribute VB_Name = "frmrelationlesson"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cobsp_Click()
Frame1.Caption = cobsp.Text
'课程
SQL = "Select 课程 From Splesson where 专业='" & Trim(cobsp.Text) & " '"
Set adoRS = adoCon.Execute(SQL)
List1.Clear
Do While Not adoRS.EOF
List1.AddItem adoRS("课程")
adoRS.MoveNext
Loop
End Sub
Private Sub Command1_Click()
If List2.ListIndex = -1 Then
MsgBox "请先选择课程", vbOKOnly + vbExclamation, "系统提示"
Exit Sub
End If
Dim a As String
a = Trim(List2.Text)
SQL = ""
SQL = "select count(*) from Splesson where 专业='" & Trim(cobsp.Text) & "' and 课程='" & a & "'"
Set adoRS = adoCon.Execute(SQL)
If adoRS(0) > 0 Then
MsgBox "名称为:" & a & "的记录已经存在!", vbOKOnly + vbExclamation, "系统提示"
Exit Sub
End If
If List2.ListIndex >= 0 Then
List1.AddItem List2.Text
'List2.RemoveItem List2.ListIndex
End If
SQL = ""
SQL = "Insert Into Splesson "
SQL = SQL & " Values('" & Trim(cobsp.Text) & "'"
SQL = SQL & ",'" & Trim(a) & "')"
adoCon.Execute (SQL)
End Sub
Private Sub Command2_Click()
If List1.ListIndex = -1 Then
MsgBox "请先选择专业", vbOKOnly + vbExclamation, "系统提示"
Exit Sub
End If
Dim i As Integer
Dim b As String
If List1.SelCount = 1 Then
'List2.AddItem List1.Text
b = List1.Text
List1.RemoveItem List1.ListIndex
ElseIf List1.SelCount > 1 Then
For i = List1.ListCount - 1 To 0 Step -1
If List1.Selected(i) Then
List2.AddItem List1.List(i)
List1.RemoveItem i
End If
Next i
End If
SQL = ""
SQL = "delete Splesson where 课程='" & b & "'"
adoCon.Execute (SQL)
'SQL = ""
'SQL = "Insert Into Class2 "
'SQL = SQL & " Values('" & b & "')"
'adoCon.Execute (SQL)
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Form_Load()
ShockwaveFlash1.Movie = App.Path & "\flash\top.swf"
Me.Height = 8655
Me.Width = 8805
Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2 - 600
'课程
Set adoRS = adoCon.Execute("Select 课程名称 From Lesson Order By 课程名称")
List2.Clear
Do While Not adoRS.EOF
List2.AddItem adoRS("课程名称")
adoRS.MoveNext
Loop
'List2.ListIndex = 0
'专业
Set adoRS = adoCon.Execute("Select Name From Speciality Order By Name")
cobsp.Clear
Do While Not adoRS.EOF
cobsp.AddItem adoRS("Name")
adoRS.MoveNext
Loop
cobsp.ListIndex = 0
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -