?? frmsearchinfo.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 frmsearchInfo
BackColor = &H00FFC0C0&
Caption = "多條件查詢"
ClientHeight = 9060
ClientLeft = 60
ClientTop = 345
ClientWidth = 10815
Icon = "frmsearchInfo.frx":0000
LinkTopic = "Form1"
ScaleHeight = 9060
ScaleWidth = 10815
StartUpPosition = 3 '窗口缺省
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 8160
Top = 120
Visible = 0 'False
Width = 1455
_ExtentX = 2566
_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 = $"frmsearchInfo.frx":3072
OLEDBString = $"frmsearchInfo.frx":30FE
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from 學生 where 學號='"" & trim(text1.text) & ""'"
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 Command2
BackColor = &H0080C0FF&
Caption = "退出&(E)"
Height = 495
Left = 8400
Style = 1 'Graphical
TabIndex = 10
Top = 1800
Width = 1215
End
Begin VB.CommandButton Command1
BackColor = &H0080C0FF&
Caption = "查詢&(S)"
Height = 495
Left = 8400
Style = 1 'Graphical
TabIndex = 9
Top = 840
Width = 1215
End
Begin VB.Frame Frame2
BackColor = &H00FFC0C0&
Caption = "學生基本信息"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 4575
Left = 240
TabIndex = 7
Top = 2520
Width = 9735
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "frmsearchInfo.frx":318A
Height = 4215
Left = 240
TabIndex = 8
Top = 240
Width = 9255
_ExtentX = 16325
_ExtentY = 7435
_Version = 393216
BackColor = 12640511
ForeColor = 255
HeadLines = 1
RowHeight = 15
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
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
End
Begin VB.Frame Frame1
BackColor = &H00FFC0C0&
Caption = "查詢依據"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 2175
Left = 240
TabIndex = 0
Top = 120
Width = 7695
Begin VB.TextBox Text1
BackColor = &H00C0E0FF&
Height = 375
Left = 3120
TabIndex = 5
Top = 1200
Width = 2775
End
Begin VB.OptionButton Option4
BackColor = &H00FFC0C0&
Caption = "院系"
Height = 255
Left = 240
TabIndex = 4
Top = 1800
Width = 855
End
Begin VB.OptionButton Option3
BackColor = &H00FFC0C0&
Caption = "專業"
Height = 255
Left = 240
TabIndex = 3
Top = 1320
Width = 855
End
Begin VB.OptionButton Option2
BackColor = &H00FFC0C0&
Caption = "班級"
Height = 255
Left = 240
TabIndex = 2
Top = 840
Width = 855
End
Begin VB.OptionButton Option1
BackColor = &H00FFC0C0&
Caption = "學號"
Height = 255
Left = 240
TabIndex = 1
Top = 360
Width = 855
End
Begin VB.Label Label1
BackColor = &H00FFC0C0&
Caption = "請輸入查詢依據:"
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 3120
TabIndex = 6
Top = 960
Width = 1695
End
End
End
Attribute VB_Name = "frmsearchInfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
On Error GoTo searcherror
If Text1.Text <> "" Then
If Option1.Value Then searchSQL = " select * from 學生 where 學號='" & Trim(Text1.Text) & "'"
If Option2.Value Then searchSQL = "select 學號,名字,性別,班級 from 學生 where 班級='" & Trim(Text1.Text) & "'"
If Option3.Value Then searchSQL = " select 學號,名字,性別,班級,專業 from 學生 where 專業='" & Trim(Text1.Text) & "'"
If Option4.Value Then searchSQL = "select 學號,名字,性別,班級,院系,專業 from 學生 where 院系='" & Trim(Text1.Text) & "'"
Else
MsgBox "查詢條件不能為空,請輸入查詢條件!"
Text1.SetFocus
End If
Adodc1.RecordSource = searchSQL
Adodc1.Refresh
If Option1.Value Then
If Adodc1.Recordset.EOF Then
MsgBox "沒有這個學生!"
End If
End If
If Option2.Value Then
If Adodc1.Recordset.EOF Then
MsgBox "沒有這個班級!"
End If
End If
If Option3.Value Then
If Adodc1.Recordset.EOF Then
MsgBox "沒有這個專業!"
End If
End If
If Option4.Value Then
If Adodc1.Recordset.EOF Then
MsgBox "沒有這個系!"
End If
End If
Exit Sub
searcherror:
MsgBox Err.Description
End Sub
Private Sub Command2_Click()
Adodc1.Recordset.Close
Unload Me
End Sub
Private Sub Form_Load()
MakeCenter frmsearchInfo
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -