?? form1.frm
字號(hào):
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 frmSearch
BackColor = &H00FFC0C0&
BorderStyle = 3 'Fixed Dialog
Caption = "成績(jī)查詢"
ClientHeight = 7515
ClientLeft = 45
ClientTop = 330
ClientWidth = 8415
FillColor = &H00C0C0C0&
ForeColor = &H00C0C0C0&
Icon = "Form1.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 7515
ScaleWidth = 8415
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame1
BackColor = &H00FFC0C0&
Caption = "查詢依據(jù)"
ForeColor = &H00000000&
Height = 1935
Left = 120
TabIndex = 4
Top = 120
Width = 6615
Begin VB.TextBox Text1
BackColor = &H00C0E0FF&
ForeColor = &H00000000&
Height = 270
Left = 2520
TabIndex = 8
Top = 840
Width = 2535
End
Begin VB.OptionButton Option1
BackColor = &H00FFC0C0&
Caption = "學(xué)號(hào):"
ForeColor = &H00000000&
Height = 300
Left = 240
TabIndex = 7
Top = 240
Value = -1 'True
Width = 1335
End
Begin VB.OptionButton Option2
BackColor = &H00FFC0C0&
Caption = "班號(hào):"
ForeColor = &H00000000&
Height = 495
Left = 240
TabIndex = 6
Top = 720
Width = 1335
End
Begin VB.OptionButton Option3
BackColor = &H00FFC0C0&
Caption = "查詢?nèi)?"
ForeColor = &H00000000&
Height = 375
Left = 240
TabIndex = 5
Top = 1440
Width = 1215
End
Begin VB.Label Label1
BackColor = &H00C0C0C0&
BackStyle = 0 'Transparent
Caption = "請(qǐng)輸入內(nèi)容:"
ForeColor = &H00000000&
Height = 255
Left = 2520
TabIndex = 9
Top = 480
Width = 1935
End
End
Begin VB.Frame Frame2
BackColor = &H00FFC0C0&
Caption = "顯示成績(jī)"
ForeColor = &H00000000&
Height = 3135
Left = 120
TabIndex = 2
Top = 2400
Width = 5295
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "Form1.frx":3072
Height = 2535
Left = 240
TabIndex = 3
Top = 360
Width = 4815
_ExtentX = 8493
_ExtentY = 4471
_Version = 393216
BackColor = 12640511
ForeColor = 255
HeadLines = 1
RowHeight = 15
FormatLocked = -1 'True
AllowAddNew = -1 'True
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Caption = "學(xué)生成績(jī)"
ColumnCount = 4
BeginProperty Column00
DataField = "課程號(hào)"
Caption = "課程號(hào)"
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
BeginProperty Column02
DataField = "成績(jī)"
Caption = "成績(jī)"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column03
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
ColumnWidth = 1019.906
EndProperty
BeginProperty Column01
ColumnWidth = 1319.811
EndProperty
BeginProperty Column02
ColumnWidth = 810.142
EndProperty
BeginProperty Column03
ColumnWidth = 1319.811
EndProperty
EndProperty
End
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 5640
Top = 5160
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 582
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 = $"Form1.frx":3087
OLEDBString = $"Form1.frx":3113
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from 學(xué)生與課程"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.CommandButton Command3
BackColor = &H0080C0FF&
Caption = "退出"
Height = 375
Left = 5640
Style = 1 'Graphical
TabIndex = 1
Top = 4680
Width = 1095
End
Begin VB.CommandButton Command1
BackColor = &H0080C0FF&
Caption = "查詢"
Height = 375
Left = 5640
Style = 1 'Graphical
TabIndex = 0
Top = 4080
Width = 1095
End
End
Attribute VB_Name = "frmSearch"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
On Error GoTo error:
If Text1.Text <> "" Then
If Option1.Value Then searchSQL = "SELECT * FROM 學(xué)生與課程 WHERE 學(xué)號(hào)=" & "'" & Text1.Text & "'"
If Option2.Value Then searchSQL = "SELECT * FROM 學(xué)生與課程 where 學(xué)號(hào) in (select 學(xué)號(hào) from 學(xué)生 where 班級(jí)= '" & Trim(Text1.Text) & " ')"
If Option3.Value Then searchSQL = "SELECT * FROM 學(xué)生與課程 "
Else
MsgBox "條件不能為空"
Text1.SetFocus
End If
' If Option1.Value Then
'Text1.Enabled = True
' Text2.Enabled = False
'Text2.ForeColor = &HC0C0C0
'Text1.SetFocus
' searchSQL = "SELECT * FROM 學(xué)生與課程 WHERE 學(xué)號(hào)=" & "'" & Text1.Text & "'"
'End If
'If Option2.Value Then
'Text2.Enabled = True
'Text1.Enabled = False
'Text1.ForeColor = &HC0C0C0
'Text2.SetFocus
'searchSQL = "SELECT * FROM 學(xué)生與課程 where 學(xué)號(hào) in (select 學(xué)號(hào) from 學(xué)生 where 班級(jí)= '" & Trim(Text2.Text) & " ')"
'End If
'If Option3.Value Then
' searchSQL = "SELECT * FROM 學(xué)生與課程 "
'End If
' End If
'Adodc1.ConnectionString = " Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\軟件工程\db5.mdb;Persist Security Info=False"
Adodc1.RecordSource = searchSQL
Adodc1.Refresh
If Option1.Value Then
If Adodc1.Recordset.EOF Then
MsgBox "沒有這個(gè)學(xué)生!"
End If
Exit Sub
End If
If Option2.Value Then
If Adodc1.Recordset.EOF Then
MsgBox "沒有這個(gè)班級(jí)!"
End If
Exit Sub
End If
If Option3.Value Then
If Adodc1.Recordset.EOF Then
MsgBox "沒有相應(yīng)的信息!"
End If
Exit Sub
End If
Exit Sub
' Set DataGrid2.DataSource = Adodc1
' DataGrid2.Refresh
error:
MsgBox Err.Description
End Sub
Private Sub DBGrid1_Click()
End Sub
Private Sub Command2_Click()
'Set Adodc1.Recordset = Nothing
'Adodc1.Recordset.Close
Text1.Text = ""
'Text2.Text = ""
Option1.Value = True
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub DataGrid2_Click()
End Sub
Private Sub Form_Load()
MakeCenter frmSearch
' If Option1.Value Then
'Text1.BackColor = &HFFFFFF
'Text1.Text = ""
' Text1.SetFocus
'End If
'If Option2.Value Then
' Text1.BackColor = &HFFFFFF
'Text1.Text = ""
'Text1.SetFocus
'End If
'If Option3.Value Then
'Text1.Enabled = False
'Text1.BackColor = &H808080
'End If
' If Option1.Value Then
' Text1.Enabled = True
' Text1.BackColor = &HFFFFFF
'Text2.Enabled = False
'Text2.BackColor = &H808080
'Text1.SetFocus
' End If
'If Option2.Value Then
' Text2.Enabled = True
'Text2.BackColor = &HFFFFFF
'Text1.Enabled = False
'Text1.BackColor = &H808080
'Text2.SetFocus
'End If
'If Option3.Value Then
' Text1.Enabled = False
' Text1.BackColor = &H808080
'Text1.Enabled = True
'Text2.Enabled = False
' Text2.BackColor = &H808080
'End If
'Adodc1.ConnectionString = " Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\軟件工程\db5.mdb;Persist Security Info=False"
'Data1.RecordSource = "SELECT 課程號(hào),課程名稱,成績(jī),備注 FROM 學(xué)生與成績(jī) where 學(xué)號(hào)=text1.text"
End Sub
'select 課程號(hào),課程名稱,成績(jī),備注 from 學(xué)生與課程 where 學(xué)號(hào)='" & Trim(Text1.Text) & "'
Private Sub Label2_Click()
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -