📄 edks.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 edks
ClientHeight = 7335
ClientLeft = 60
ClientTop = 450
ClientWidth = 11115
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 7335
ScaleWidth = 11115
StartUpPosition = 2 '屏幕中心
Begin VB.OptionButton Opt2
Caption = "女"
Height = 495
Left = 5700
TabIndex = 11
Top = 6315
Width = 645
End
Begin VB.OptionButton Opt1
Caption = "男"
Height = 495
Left = 4980
TabIndex = 10
Top = 6315
Width = 690
End
Begin VB.TextBox Text1
Height = 885
Index = 2
Left = 1200
TabIndex = 4
Top = 6000
Width = 3255
End
Begin VB.TextBox Text1
Height = 375
Index = 0
Left = 1200
TabIndex = 3
Tag = "0"
Top = 5520
Width = 1215
End
Begin VB.Frame Frame2
Caption = "操作按钮"
Height = 2175
Left = 7860
TabIndex = 2
Top = 5010
Width = 3075
Begin VB.CommandButton retCom
Caption = "返回"
Height = 480
Left = 2115
TabIndex = 17
Top = 1380
Width = 720
End
Begin VB.CommandButton Comm3
Caption = "删除"
Height = 480
Left = 210
TabIndex = 16
Top = 1380
Width = 720
End
Begin VB.CommandButton Comm2
Caption = "修改"
Height = 480
Left = 210
TabIndex = 15
Top = 870
Width = 720
End
Begin VB.CommandButton Comm1
Caption = "添加"
Height = 480
Left = 210
TabIndex = 14
Top = 360
Width = 720
End
End
Begin VB.Frame Frame1
Caption = "设置条件"
Height = 2175
Left = 105
TabIndex = 1
Top = 5010
Width = 7650
Begin VB.CommandButton selcmd2
Caption = "重置"
Height = 420
Left = 6315
TabIndex = 13
Top = 1275
Width = 945
End
Begin VB.CommandButton selcmd1
Caption = "确定"
Height = 420
Left = 6315
TabIndex = 12
Top = 525
Width = 945
End
Begin VB.Frame Frame3
Caption = "性别"
Height = 810
Left = 4620
TabIndex = 9
Top = 1065
Width = 1650
End
Begin VB.TextBox Text1
Height = 375
Index = 1
Left = 3720
TabIndex = 5
Top = 480
Width = 1575
End
Begin VB.Label Label3
Caption = "出生日期"
Height = 345
Left = 2910
TabIndex = 8
Top = 585
Width = 1080
End
Begin VB.Label Label2
Alignment = 1 'Right Justify
Caption = "通信地址"
Height = 330
Left = 135
TabIndex = 7
Top = 1050
Width = 795
End
Begin VB.Label Label1
Alignment = 1 'Right Justify
Caption = "姓名"
Height = 315
Left = 270
TabIndex = 6
Top = 585
Width = 660
End
End
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "edks.frx":0000
Height = 4290
Left = 120
TabIndex = 0
Top = 525
Width = 10830
_ExtentX = 19103
_ExtentY = 7567
_Version = 393216
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 MSAdodcLib.Adodc Adodc1
Height = 360
Left = 615
Top = 105
Visible = 0 'False
Width = 1500
_ExtentX = 2646
_ExtentY = 635
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 = "Provider=SQLOLEDB.1;Password=sa;Persist Security Info=True;User ID=sa;Initial Catalog=KSD;Data Source=user76"
OLEDBString = "Provider=SQLOLEDB.1;Password=sa;Persist Security Info=True;User ID=sa;Initial Catalog=KSD;Data Source=user76"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from ksb"
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
End
Attribute VB_Name = "edks"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Comm3_Click()
If MsgBox("真的要删除[" + Trim(Adodc1.Recordset.Fields("姓名")) + "]吗?", _
vbYesNo, "信息提示") = vbYes Then
Adodc1.Recordset.Delete
recs = recs - 1
Adodc1.Recordset.Update
Call encom
End If
End Sub
Private Sub form_load()
Adodc1.Refresh
recs = Adodc1.Recordset.RecordCount
If recs > 0 Then
Adodc1.Recordset.MoveFirst
num = Val(Adodc1.Recordset.Fields("报名号"))
Adodc1.Recordset.MoveFirst
Else
num = 0
End If
End Sub
Private Sub form_active()
DataGrid1.SetFocus
Call encom
End Sub
Private Sub comm1_click()
'插入部分自行补齐
End Sub
Private Sub comm2_click()
Dim num1 As String
flag = 2
num1 = Adodc1.Recordset.Fields("报名号")
Adodc1.Recordset.Find ("报名号='" & num1 & "'")
edks1.Show vbModal
End Sub
Private Sub retCom_Click()
Unload Me
End Sub
Private Sub selcmd1_Click()
If Trim(Text1(1).Text) <> "" Then
If Not IsDate(Trim(Text1(1).Text)) Then
MsgBox "出生日期输入错误,应为yyyy-mm-dd类型", vbOKOnly, "信息提示"
Text1(1).SetFocus
Exit Sub
End If
End If
condstr = ""
If Trim(Text1(0).Text) <> "" Then
If condstr = "" Then
condstr = "姓名 like '" + Trim(Text1(0).Text) + "'"
Else
condstr = condstr + " and 姓名 like '" + Trim(Text1(0).Text) + "'"
End If
End If
If Trim(Text1(1).Text) <> "" Then
If condstr = "" Then
condstr = "出生日期='" + Format(Trim(Text1(1).Text), _
"yyyy.mm.dd") + "'"
Else
condstr = condstr + " and 出生日期 = '" + Format(Trim(Text1(1).Text), _
"yyyy.mm.dd") + "'"
End If
End If
If Trim(Text1(2).Text) <> "" Then
If condstr = "" Then
condstr = "通信地址 like '" + Trim(Text1(2).Text) + "'"
Else
condstr = condstr + " and 通信地址 like '" + Trim(Text1(2).Text) + "'"
End If
End If
If Opt1.Value = True Then
If condstr = "" Then
condstr = "性别='男'"
Else
condstr = condstr + " and 性别='男'"
End If
ElseIf Opt2.Value = True Then
If condstr = "" Then
condstr = "性别='女'"
Else
condstr = condstr + " and 性别='女'"
End If
End If
If condstr <> "" Then '有条件的查找
Adodc1.RecordSource = "select * from ksb where " + condstr
Adodc1.Refresh
Else '无条件的查找
Adodc1.RecordSource = "select * from ksb"
Adodc1.Refresh
End If
recs = Adodc1.Recordset.RecordCount
If recs = 0 Then
MsgBox " 没有任何满足条件的记录", vbOKOnly, "信息提示"
End If
Call encomm
End Sub
Private Sub selcmd2_Click()
Text1(0).Text = ""
Text1(1).Text = ""
Text1(2).Text = ""
Opt1.Value = False
Opt2.Value = False
End Sub
Private Sub encomm()
If recs = 0 Then
Comm2.Enabled = False
Comm3.Enabled = False
Else
Comm2.Enabled = True
Comm3.Enabled = True
End If
End Sub
Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer)
Call endata(KeyAscii)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -