??
字號:
VERSION 5.00
Begin VB.Form 瀏覽學生成績
Caption = "瀏覽學生成績"
ClientHeight = 3090
ClientLeft = 60
ClientTop = 450
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3090
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton CmdLast
Height = 375
Left = 3600
Picture = "瀏覽學生成績.frx":0000
Style = 1 'Graphical
TabIndex = 14
Top = 2640
Width = 495
End
Begin VB.CommandButton CmdNext
Height = 375
Left = 2520
Picture = "瀏覽學生成績.frx":0442
Style = 1 'Graphical
TabIndex = 13
Top = 2640
Width = 495
End
Begin VB.CommandButton CmdPre
Height = 375
Left = 1440
Picture = "瀏覽學生成績.frx":0884
Style = 1 'Graphical
TabIndex = 12
Top = 2640
Width = 495
End
Begin VB.CommandButton CmdFirst
Height = 375
Left = 240
Picture = "瀏覽學生成績.frx":0CC6
Style = 1 'Graphical
TabIndex = 11
Top = 2640
Width = 495
End
Begin VB.CommandButton CmdEND
Caption = "結束"
Height = 495
Left = 2880
TabIndex = 10
Top = 1680
Width = 1215
End
Begin VB.CommandButton CmdCANCEL
Caption = "中斷"
Height = 495
Left = 2880
TabIndex = 9
Top = 960
Width = 1215
End
Begin VB.CommandButton CmdFIND
Caption = "查找"
Height = 495
Left = 2880
TabIndex = 8
Top = 240
Width = 1215
End
Begin VB.TextBox TxtSCORE
Height = 375
Left = 1200
TabIndex = 7
Top = 1920
Width = 975
End
Begin VB.TextBox TxtAGE
Height = 375
Left = 1200
TabIndex = 6
Top = 1320
Width = 975
End
Begin VB.TextBox TxtSNAME
Height = 375
Left = 1200
TabIndex = 5
Top = 720
Width = 975
End
Begin VB.TextBox TxtSN
Height = 375
Left = 1200
TabIndex = 4
Top = 120
Width = 975
End
Begin VB.Label Label4
Caption = "成績"
Height = 255
Left = 240
TabIndex = 3
Top = 2040
Width = 615
End
Begin VB.Label Label3
Caption = "年齡"
Height = 255
Left = 240
TabIndex = 2
Top = 1440
Width = 615
End
Begin VB.Label Label2
Caption = "姓名"
Height = 255
Left = 240
TabIndex = 1
Top = 840
Width = 615
End
Begin VB.Label Label1
Caption = "學號"
Height = 255
Left = 240
TabIndex = 0
Top = 240
Width = 615
End
End
Attribute VB_Name = "瀏覽學生成績"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim cmd As New ADODB.Command
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Private Sub CmdCANCEL_Click()
Form_Load.Show
End Sub
Private Sub CmdEND_Click()
End
End Sub
Private Sub CmdFIND_Click()
cmd.ActiveConnection = cn
cmd.CommandText = Trim(TxtSN.Text)
Set rs = cmd.Execute
While Not rs.EOF
MsgBox CStr(rs.Fields("Score").Value)
Wend
End Sub
Private Sub CmdFirst_Click()
rs.MoveFirst
End Sub
Private Sub CmdLast_Click()
rs.MoveLast
End Sub
Private Sub CmdNext_Click()
rs.MoveNext
If rs.EOF = True Then
rs.MoveLast
End If
End Sub
Private Sub CmdPre_Click()
rs.MovePrevious
If rs.BOF = True Then
rs.MoveFirst
End If
End Sub
Private Sub Form_Load()
Dim ssql As String
On Error GoTo donothing
ssql = "driver={sql server};server=6F358FC41A8D47A;database=school"
cn.ConnectionString = ssql
cn.Open
Exit Sub
donothing:
MsgBox "數據庫連接錯誤", vbCritical, "system information"
End
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -