?? frm_ygxxcx.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 Frm_ygxxcx
BorderStyle = 1 'Fixed Single
Caption = "員工信息查詢"
ClientHeight = 4935
ClientLeft = 45
ClientTop = 435
ClientWidth = 8505
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4935
ScaleWidth = 8505
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton cmd_cancel
Caption = "取消"
Height = 375
Left = 7485
TabIndex = 2
Top = 4515
Width = 975
End
Begin VB.CommandButton cmd_ok
Caption = "查詢"
Height = 375
Left = 6525
TabIndex = 1
Top = 4515
Width = 975
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 180
Top = 5085
Width = 2895
_ExtentX = 5106
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
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.Frame Frame1
Caption = "查詢條件"
Height = 975
Left = 45
TabIndex = 0
Top = 30
Width = 8415
Begin VB.ComboBox Combo1
Height = 300
ItemData = "Frm_ygxxcx.frx":0000
Left = 4305
List = "Frm_ygxxcx.frx":000A
Style = 2 'Dropdown List
TabIndex = 8
Top = 345
Width = 975
End
Begin VB.TextBox Text2
Height = 300
Left = 6825
TabIndex = 7
Top = 345
Width = 1455
End
Begin VB.TextBox Text1
Height = 300
Left = 1545
TabIndex = 6
Top = 345
Width = 1215
End
Begin VB.OptionButton Opt_address
Caption = "按照籍貫查詢"
Height = 255
Left = 5385
TabIndex = 5
Top = 375
Width = 1575
End
Begin VB.OptionButton Opt_sex
Caption = "按照性別查詢"
Height = 255
Left = 2865
TabIndex = 4
Top = 375
Width = 1575
End
Begin VB.OptionButton Opt_name
Caption = "按照姓名查詢"
Height = 255
Left = 105
TabIndex = 3
Top = 375
Width = 1575
End
End
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "Frm_ygxxcx.frx":0016
Height = 3405
Left = 60
TabIndex = 9
Top = 1050
Width = 8385
_ExtentX = 14790
_ExtentY = 6006
_Version = 393216
AllowUpdate = 0 'False
AllowArrows = 0 'False
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
Begin VB.Label Label1
Caption = "Label1"
Height = 270
Left = 120
TabIndex = 10
Top = 4590
Width = 3510
End
End
Attribute VB_Name = "Frm_ygxxcx"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Cmd_Cancel_Click()
Unload Me
End Sub
Private Sub Cmd_Ok_Click()
If Opt_name.Value = True Then
Adodc1.RecordSource = "select * from 員工信息 where 員工姓名='" + Text1.Text + "' order by 員工編號"
Adodc1.Refresh
ElseIf Opt_sex.Value = True Then
Adodc1.RecordSource = "select * from 員工信息 where 性別='" + Combo1.Text + "' order by 員工編號"
Adodc1.Refresh
ElseIf Opt_address.Value = True Then
Adodc1.RecordSource = "select * from 員工信息 where 籍貫='" + Text2.Text + "' order by 員工編號"
Adodc1.Refresh
End If
'顯示查詢結果
Label1.Caption = "查詢到數據記錄 " + Str(Adodc1.Recordset.RecordCount) + " 條"
End Sub
Private Sub Form_Load()
Adodc1.ConnectionString = MyStrs
Adodc1.RecordSource = "select * from 員工信息 order by 員工編號"
Adodc1.Refresh
Label1.Caption = "當前數據記錄 " + Str(Adodc1.Recordset.RecordCount) + " 條"
'默認條件下設置為按姓名查詢
Opt_name.Value = True
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -