📄 quks.frm
字号:
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column02
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 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
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 = 1200.189
EndProperty
BeginProperty Column01
ColumnWidth = 1005.165
EndProperty
BeginProperty Column02
ColumnWidth = 494.929
EndProperty
BeginProperty Column03
ColumnWidth = 1200.189
EndProperty
BeginProperty Column04
ColumnWidth = 3000.189
EndProperty
BeginProperty Column05
ColumnWidth = 1200.189
EndProperty
BeginProperty Column06
ColumnWidth = 1200.189
EndProperty
EndProperty
End
End
Attribute VB_Name = "quks"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Const BlockSize = 100000
Dim NumBlocks As Integer
Dim FileLength As Long
Dim LeftOver As Long
Dim i As Integer
Dim n As Integer
Dim ByteDate() As Byte
Dim FileName As String
Dim FileNum As Integer
Dim DiskFile As String
Private Sub Form_Load()
recs = Adodc1.Recordset.RecordCount
DiskFile = App.Path & "\image1.bmp"
End Sub
Private Sub Form_activate()
DataGrid1.SetFocus
Call encomm
End Sub
Private Sub Comm1_Click()
Dim Num1 As String
Num1 = Adodc1.Recordset.Fields("报名号") '不能用DataGrid导航,应使用Find方法指向修改的记录
Adodc1.Recordset.MoveFirst
Adodc1.Recordset.Find ("报名号'" & Num1 & "'")
sel = False
If Adodc1.Recordset.Fields("照片长度") > 0 Then
'将当前记录的照片数据存放在临时文件image1.bmp中
sel = True
Me.MousePointer = vbHourglass
If FileLength > 10000 Then
n = 5
Else
n = 10
End If
If Len(Dir$(DiskFile)) > 0 Then
Kill DiskFile '删除原来存在的临时文件
End If
FileNum = FreeFile()
Open DiskFile For Binary Access Write As FileNum '打开文件
NumBlocks = FileLength \ (BlockSize \ n)
LeftOver = FileLength Mod (BlockSize \ n) '余下的长度
ReDim ByteData(BlockSize \ n)
For i = 1 To NumBlocks
ByteData() = Adodc1.Recordset("照片").GetChunk(BlockSize \ n)
Put FileNum, , ByteData
Next i
If LeftOver > 0 Then
ReDim ByteData(LeftOver)
ByteData() = Adodc1.Recordset("照片").GetChunk(LeftOver)
Put FileNum, , ByteData
End If
Close FileNum '关闭文件
Me.MousePointer = vbNormal
End If
quks1.PrintForm
Unload quks1
End Sub
Private Sub Comm2_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 * frm 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() '自定义子过程,判断Adodc1中是否存在记录
If recs = 0 Then
Comm1.Enabled = False
Else
Comm1.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 + -