?? frmcourse.frm
字號:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form frmCourse
Caption = "課表查詢"
ClientHeight = 5415
ClientLeft = 60
ClientTop = 345
ClientWidth = 8190
Icon = "frmCourse.frx":0000
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 5415
ScaleWidth = 8190
Begin MSFlexGridLib.MSFlexGrid fgList
Height = 4335
Left = 0
TabIndex = 8
Top = 1080
Width = 8175
_ExtentX = 14420
_ExtentY = 7646
_Version = 393216
AllowUserResizing= 3
End
Begin VB.Frame Frame1
Height = 975
Left = 0
TabIndex = 0
Top = 0
Width = 8175
Begin VB.CommandButton btnSearch
Caption = "搜索"
Height = 375
Left = 6120
TabIndex = 7
Top = 360
Width = 855
End
Begin VB.TextBox txbOne
Height = 375
Left = 600
TabIndex = 3
Top = 360
Width = 1575
End
Begin VB.TextBox txbTwo
Enabled = 0 'False
Height = 375
Left = 2880
TabIndex = 2
Top = 360
Width = 975
End
Begin VB.TextBox txbThree
Enabled = 0 'False
Height = 375
Left = 4680
TabIndex = 1
Top = 360
Width = 975
End
Begin VB.Label Label1
Caption = "學號"
Height = 255
Left = 120
TabIndex = 6
Top = 480
Width = 615
End
Begin VB.Label Label2
Caption = "姓名"
Height = 255
Left = 2520
TabIndex = 5
Top = 480
Width = 615
End
Begin VB.Label Label3
Caption = "班級"
Height = 255
Left = 4200
TabIndex = 4
Top = 480
Width = 495
End
End
End
Attribute VB_Name = "frmCourse"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Sub LoadData()
Dim strFilter As String
If Len(Trim(txbOne.Text)) = 0 Then
Exit Sub
Else
strFilter = " and 學號='" + Trim(txbOne.Text) + "'"
End If
Dim db As New DataBases
Dim strSQL As String
strSQL = "select 姓名, 班級名稱 from 學生信息 as a, 班級信息 as b where a.班級編號=b.班級編號 and 學號='" + Trim(Me.txbOne.Text) + "'"
Dim rs As Recordset
Set rs = db.RunSelectSQL(strSQL)
If rs.RecordCount = 0 Then
MsgBox ("學號錯誤!")
Exit Sub
End If
Me.txbTwo.Text = Trim(rs(0))
Me.txbThree.Text = Trim(rs(1))
strSQL = "select b.課程名稱,a.上課時間天,a.上課時間節,a.上課地點 from 選課表 as c, 課程表 as a, 課程信息 as b where a.課程編號=b.課程編號 and c.課序號=a.課序號"
Set rs = db.RunSelectSQL(strSQL + strFilter + " order by a.課序號 ")
For m = 1 To 5
For n = 1 To 10
fgList.TextMatrix(n, m) = ""
Next
Next
Dim col As Integer
Dim line As Integer
While (Not rs.EOF)
col = CInt(CStr(rs(1)))
line = CInt(rs(2))
fgList.TextMatrix(line, col) = Trim(rs(0)) + " " + Trim(rs(3))
rs.MoveNext
Wend
End Sub
Private Sub btnSearch_Click()
LoadData
End Sub
Private Sub Form_Load()
fgList.Cols = 6
fgList.Rows = 11
For i = 1 To 10
fgList.TextMatrix(i, 0) = i
Next
fgList.TextMatrix(0, 1) = "星期一"
fgList.TextMatrix(0, 2) = "星期二"
fgList.TextMatrix(0, 3) = "星期三"
fgList.TextMatrix(0, 4) = "星期四"
fgList.TextMatrix(0, 5) = "星期五"
LoadData
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -