📄 form3.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form 学习成绩查询
Caption = "学习成绩查询"
ClientHeight = 5790
ClientLeft = 60
ClientTop = 345
ClientWidth = 7935
LinkTopic = "Form1"
ScaleHeight = 5790
ScaleWidth = 7935
StartUpPosition = 3 'Windows Default
Begin VB.Frame Frame1
Caption = " 请输入学号:"
Height = 5295
Left = 240
TabIndex = 0
Top = 240
Width = 7455
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "form3.frx":0000
Height = 3015
Left = 240
TabIndex = 3
Top = 960
Width = 6735
_ExtentX = 11880
_ExtentY = 5318
_Version = 393216
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin VB.CommandButton Command1
Caption = "确 定"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 5040
TabIndex = 2
Top = 360
Width = 2055
End
Begin VB.TextBox Text1
DataSource = "Adodc1"
Height = 375
Left = 120
TabIndex = 1
Top = 360
Width = 3975
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 360
Top = 4680
Width = 6615
_ExtentX = 11668
_ExtentY = 661
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=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=成绩查询"
OLEDBString = "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=成绩查询"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = "sa"
RecordSource = "select * from cjpm"
Caption = ""
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.Label Label2
Caption = "总成绩:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 240
TabIndex = 7
Top = 4200
Width = 975
End
Begin VB.Label Label3
BackColor = &H00FFFFFF&
Height = 375
Left = 1440
TabIndex = 6
Top = 4080
Width = 1575
End
Begin VB.Label Label4
Caption = "排 名:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 4200
TabIndex = 5
Top = 4200
Width = 735
End
Begin VB.Label Label5
BackColor = &H00FFFFFF&
Height = 375
Left = 5400
TabIndex = 4
Top = 4080
Width = 1695
End
End
End
Attribute VB_Name = "学习成绩查询"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
Dim MsgText As String
Dim sMeg As String
If Text1.Text = "" Then
sMeg = "学号不能为空"
MsgBox sMeg, vbOKOnly + vbExclamation, "警告"
Text1.SetFocus
Exit Sub
Else
If Not IsNumeric(Text1.Text) Then
MsgBox "请输入数字!", vbOKOnly + vbExclamation, "警告"
Text1.SetFocus
Text1.Text = ""
Exit Sub
End If
End If
Adodc1.RecordSource = "select * from cjpm where 学号 = " & Text1.Text & ""
Adodc1.Refresh
If Adodc1.Recordset.BOF And Adodc1.Recordset.EOF Then
MsgBox "学号不存在!请重新输入!", vbOKOnly, "错误"
Text1.Text = ""
Exit Sub
Else
Adodc1.Refresh
If DataGrid1.Row < 0 Then
MsgBox "学号不存在!请重新输入!", vbOKOnly, "错误"
Text1.Text = ""
Exit Sub
Else
DataGrid1.Row = 0
DataGrid1.Col = 3
Label3.Caption = DataGrid1.Text
DataGrid1.Row = 0
DataGrid1.Col = 4
Label5.Caption = DataGrid1.Text
End If
End If
'以下代码用于选出记录
' If Text1.Text <> " " Then
' Adodc1.RecordSource = "select * from cjcx_jcb Where 学号=" & Text1.Text & ""
' Adodc1.Refresh
' Adodc1.UpdateControls
' End If
'
' 以下代码表示某个单元格
' DataGrid1.Row = 0
' DataGrid1.Col = 3
' Label3.Caption = DataGrid1.Text
'
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -