📄 按教师号查询教师授课情况.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form Form6
BackColor = &H00FFFF00&
Caption = "Form6"
ClientHeight = 4275
ClientLeft = 60
ClientTop = 435
ClientWidth = 5685
LinkTopic = "Form6"
ScaleHeight = 4275
ScaleWidth = 5685
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command3
Caption = "退出"
BeginProperty Font
Name = "楷体_GB2312"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 4320
TabIndex = 5
Top = 3480
Width = 1335
End
Begin VB.CommandButton Command2
Caption = "清空"
BeginProperty Font
Name = "楷体_GB2312"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 4320
TabIndex = 4
Top = 1800
Width = 1335
End
Begin VB.CommandButton Command1
Caption = "查询"
BeginProperty Font
Name = "楷体_GB2312"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 4320
TabIndex = 3
Top = 240
Width = 1335
End
Begin VB.TextBox Text1
Height = 615
Left = 2160
TabIndex = 2
Top = 240
Width = 2055
End
Begin MSFlexGridLib.MSFlexGrid MSG
Height = 2775
Left = 120
TabIndex = 0
Top = 1200
Width = 4035
_ExtentX = 7117
_ExtentY = 4895
_Version = 393216
BackColorBkg = 12632256
FillStyle = 1
AllowUserResizing= 3
FormatString = " "
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin VB.Label Label1
BackColor = &H00FFFF00&
Caption = "教师号"
BeginProperty Font
Name = "楷体_GB2312"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 240
TabIndex = 1
Top = 240
Width = 1815
End
End
Attribute VB_Name = "Form6"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim cnn As ADODB.Connection
Dim rs As ADODB.Recordset
Set cnn = New ADODB.Connection
Set rs = New ADODB.Recordset
Dim connectionString As String
connectionString = "dsn=教师授课;uid=sa;pwd="
cnn.Open connectionString
Dim sqlString As String
sqlString = "SELECT dbo.课程基本信息.课程名, dbo.教师基本信息.姓名" & _
" FROM dbo.课程基本信息 INNER JOIN" & _
" dbo.教师基本信息 ON dbo.课程基本信息.教师号 = dbo.教师基本信息.教师号" & _
" WHERE dbo.教师基本信息.教师号='" & Text1.Text & "'"
rs.Open sqlString, cnn
MSG.Clear
i = 1
MSG.Cols = 2
MSG.Rows = 1
MSG.TextMatrix(0, 0) = "课程名"
MSG.TextMatrix(0, 1) = "姓名"
Do While Not rs.EOF
MSG.Rows = MSG.Rows + 1
MSG.TextMatrix(i, 0) = rs.Fields(0)
MSG.TextMatrix(i, 1) = rs.Fields(1)
i = i + 1
rs.MoveNext
Loop
rs.Close
cnn.Close
End Sub
Private Sub Command2_Click()
Text1.Text = ""
End Sub
Private Sub Command3_Click()
Unload Me
Form1.Show
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -