📄 edks.frm
字号:
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column04
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 Column05
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 Column06
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 = 1005.165
EndProperty
BeginProperty Column01
ColumnWidth = 1005.165
EndProperty
BeginProperty Column02
ColumnWidth = 599.811
EndProperty
BeginProperty Column03
ColumnWidth = 1200.189
EndProperty
BeginProperty Column04
ColumnWidth = 3000.189
EndProperty
BeginProperty Column05
ColumnWidth = 1305.071
EndProperty
BeginProperty Column06
ColumnWidth = 1305.071
EndProperty
EndProperty
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 1680
Top = 0
Visible = 0 'False
Width = 1935
_ExtentX = 3413
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 3
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "DSN=KS"
OLEDBString = ""
OLEDBFile = ""
DataSourceName = "KS"
OtherAttributes = ""
UserName = "yilin"
Password = "b606"
RecordSource = "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 Form_Load()
recs = Adodc1.Recordset.RecordCount
If recs > 0 Then '求出当前报名号
Adodc1.Recordset.MoveLast
num = Val(Adodc1.Recordset.Fields("报名号"))
Adodc1.Recordset.MoveFirst
Else
num = 0
End If
End Sub
Private Sub Form_activate()
DataGrid1.SetFocus '焦点移到DataGrid1控件
Call encomm
End Sub
Private Sub Comm1_Click()
flag = 1 '设置全局变量
edks1.Show vbModal '以模式方式调用edks1窗体
End Sub
Private Sub Comm2_Click()
Dim Num1 As String
flag = 2 '设置全局变量
Num1 = Adodc1.Recordset.Fields("报名号")
'不能用DataGrid导航,应使用Find方法找到被修改的记录
Adodc1.Recordset.MoveFirst
Adodc1.Recordset.Find ("报名号='" & Num1 & "'")
edks1.Show vbModal '以模式方式调用edks1窗体
End Sub
Private Sub Comm3_click()
If MsgBox("真的要删除[" + Trim(Adodc1.Recordset.Fields("姓名")) + "]吗?", _
vbYesNo, "信息提示") = vbYes Then
Adodc1.Recordset.Delete
recs = recs - 1 '记录个数减少1
Adodc1.Recordset.Update
Call encomm
End If
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
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() '自定义子过程:判断Adodc1中是否存在记录
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 + -