📄 frmlunwenketicl.frm
字号:
If Not (dd(2) Or dd(3)) Then
MsgBox "请设置查询方式!", vbOKOnly + vbExclamation, "警告"
Exit Sub
End If
'查询所有满足条件的内容
txtSQL = txtSQL & " order by lunwen_id"
'执行查询语句
Set mrc = ExecuteSQL(txtSQL, MsgText)
Label1.Caption = txtSQL
'''''''''''''''''''''''''''''''''''''''''''''''''''''''判断并显示
'将查询内容显示在表格控件中
With myflexgrid
.Rows = 1
.CellAlignment = 4
.TextMatrix(0, 0) = "编号"
.TextMatrix(0, 1) = "题目"
.TextMatrix(0, 2) = "作者"
.TextMatrix(0, 3) = "字数"
.TextMatrix(0, 4) = "刊物名称"
.TextMatrix(0, 5) = "级别"
.TextMatrix(0, 6) = "出版社"
.TextMatrix(0, 7) = "出版日期"
.TextMatrix(0, 8) = "页码"
.TextMatrix(0, 9) = ""
'判断是否移动到数据集对象的最后一条记录
Do While Not mrc.EOF
.Rows = .Rows + 1
.CellAlignment = 4
.TextMatrix(.Rows - 1, 0) = "" & mrc.Fields(0)
.TextMatrix(.Rows - 1, 1) = "" & mrc.Fields(1)
.TextMatrix(.Rows - 1, 2) = "" & mrc.Fields(2)
.TextMatrix(.Rows - 1, 3) = "" & mrc.Fields(3)
.TextMatrix(.Rows - 1, 4) = "" & mrc.Fields(4)
.TextMatrix(.Rows - 1, 5) = "" & mrc.Fields(5)
.TextMatrix(.Rows - 1, 6) = "" & mrc.Fields(6)
.TextMatrix(.Rows - 1, 7) = "" & Format(mrc.Fields(7), "yyyy-mm-dd")
.TextMatrix(.Rows - 1, 8) = "" & mrc.Fields(8)
.TextMatrix(.Rows - 1, 9) = ""
'移动到下一条记录
mrc.MoveNext
Loop
End With
If myflexgrid.Rows = 1 Then MsgBox "No Records Found"
'关闭数据集
mrc.Close
Exit Sub
End If '''''''''''''''''checklunwen完
If Checkren.value Then
If (Checklunwen.value Or Checklunwen.value) Then
MsgBox "请做单一选择"
Exit Sub
End If
txtSQL = "select zuozhe,lunwen_id,keti_id from lunwenguanli,ketiguanli where zuozhe=zhuchiren and "
If Trim(Text5.Text) = "" Then
sMeg = "查询不能为空!"
MsgBox sMeg, vbOKOnly + vbExclamation, "警告"
Text5.SetFocus
Exit Sub
Else
dd(5) = True
If Cbo_Oper.ListIndex = 0 Then
txtSQL = txtSQL & "zuozhe " & Cbo_Oper & " '%" & Text5.Text & "%'"
Else
txtSQL = txtSQL & " zuozhe " & Cbo_Oper & " '" & Text5.Text & "'"
End If
End If
If Not dd(5) Then
MsgBox "请设置查询方式!", vbOKOnly + vbExclamation, "警告"
Exit Sub
End If
Set mrc = ExecuteSQL(txtSQL, MsgText)
Label1.Caption = txtSQL
'''''''''''''''''''''''''''''''''''''''''''''''''''''''判断并显示
'将查询内容显示在表格控件中
With myflexgrid
.Rows = 1
.CellAlignment = 4
.TextMatrix(0, 0) = "作者"
.TextMatrix(0, 1) = "论文编号"
.TextMatrix(0, 2) = "课题编号"
.TextMatrix(0, 3) = ""
.TextMatrix(0, 4) = ""
.TextMatrix(0, 5) = ""
.TextMatrix(0, 6) = ""
.TextMatrix(0, 7) = ""
.TextMatrix(0, 8) = ""
.TextMatrix(0, 9) = ""
'判断是否移动到数据集对象的最后一条记录
Do While Not mrc.EOF
.Rows = .Rows + 1
.CellAlignment = 4
.TextMatrix(.Rows - 1, 0) = "" & mrc.Fields(0)
.TextMatrix(.Rows - 1, 1) = "" & mrc.Fields(1)
.TextMatrix(.Rows - 1, 2) = "" & mrc.Fields(2)
.TextMatrix(.Rows - 1, 3) = ""
.TextMatrix(.Rows - 1, 4) = ""
.TextMatrix(.Rows - 1, 5) = ""
.TextMatrix(.Rows - 1, 6) = ""
.TextMatrix(.Rows - 1, 7) = ""
.TextMatrix(.Rows - 1, 8) = ""
.TextMatrix(.Rows - 1, 9) = ""
mrc.MoveNext
Loop
End With
''''''判断出错信息
If myflexgrid.Rows = 1 Then MsgBox "No Records Found"
'关闭数据集
mrc.Close
Exit Sub
End If
End Sub
Private Sub cmdlunwen_Click()
Dim txtSQL As String
Dim MsgText As String
Dim mrc As ADODB.Recordset
If (Checkketi.value And Checklunwen) Then
MsgBox "请选择与您要查询的记录内容相对应的复选框"
Else
If Checkketi.value Then
With myflexgrid
.ColWidth(0) = 900
.ColWidth(1) = 1100
.ColWidth(2) = 800
.ColWidth(3) = 700
.ColWidth(4) = 1500
.ColWidth(5) = 700
.ColWidth(6) = 800
.ColWidth(7) = 1000
.ColWidth(8) = 1100
.ColWidth(9) = 1000
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''
.CellAlignment = 4
.CellAlignment = 4
.TextMatrix(0, 0) = "编号"
.TextMatrix(0, 1) = "名称"
.TextMatrix(0, 2) = "主持人"
.TextMatrix(0, 3) = "资金"
.TextMatrix(0, 4) = "参加人"
.TextMatrix(0, 5) = "完成情况"
.TextMatrix(0, 6) = "项目来源"
.TextMatrix(0, 7) = "开始日期"
.TextMatrix(0, 8) = "结论"
.TextMatrix(0, 9) = "终止日期"
End With
'显示所有课题信息
txtSQL = "select * from ketiguanli "
Set mrc = ExecuteSQL(txtSQL, MsgText)
With myflexgrid
.Rows = 1
.CellAlignment = 4
.TextMatrix(0, 0) = "编号"
.TextMatrix(0, 1) = "名称"
.TextMatrix(0, 2) = "主持人"
.TextMatrix(0, 3) = "资金"
.TextMatrix(0, 4) = "参加人"
.TextMatrix(0, 5) = "完成情况"
.TextMatrix(0, 6) = "项目来源"
.TextMatrix(0, 7) = "开始日期"
.TextMatrix(0, 8) = "结论"
.TextMatrix(0, 9) = "终止日期"
Do While Not mrc.EOF
.Rows = .Rows + 1
.CellAlignment = 4
.TextMatrix(.Rows - 1, 0) = "" & mrc.Fields(0)
.TextMatrix(.Rows - 1, 1) = "" & mrc.Fields(1)
.TextMatrix(.Rows - 1, 2) = "" & mrc.Fields(2)
.TextMatrix(.Rows - 1, 3) = "" & mrc.Fields(3)
.TextMatrix(.Rows - 1, 4) = "" & mrc.Fields(4)
.TextMatrix(.Rows - 1, 5) = "" & mrc.Fields(5)
.TextMatrix(.Rows - 1, 6) = "" & mrc.Fields(6)
.TextMatrix(.Rows - 1, 7) = "" & Format(mrc.Fields(7), "yyyy-mm-dd")
.TextMatrix(.Rows - 1, 8) = "" & mrc.Fields(8)
.TextMatrix(.Rows - 1, 9) = "" & Format(mrc.Fields(9), "yyyy-mm-dd")
'移动到下一条记录
mrc.MoveNext
Loop
End With
mrc.Close
End If
If Checklunwen.value Then
With myflexgrid
.ColWidth(0) = 1000
.ColWidth(1) = 1000
.ColWidth(2) = 1000
.ColWidth(3) = 1000
.ColWidth(4) = 1500
.ColWidth(5) = 1000
.ColWidth(6) = 1500
.ColWidth(7) = 1000
.ColWidth(8) = 1050
' ''''''''''''''''''''''''''''''''''''''''''''''''''''''''
.CellAlignment = 4
.TextMatrix(0, 0) = "编号"
.TextMatrix(0, 1) = "题目"
.TextMatrix(0, 2) = "作者"
.TextMatrix(0, 3) = "字数"
.TextMatrix(0, 4) = "刊物名称"
.TextMatrix(0, 5) = "级别"
.TextMatrix(0, 6) = "出版社"
.TextMatrix(0, 7) = "出版日期"
.TextMatrix(0, 8) = "页码"
End With
'显示所有论文信息
txtSQL = "select * from lunwenguanli "
Set mrc = ExecuteSQL(txtSQL, MsgText)
With myflexgrid
.Rows = 1
.CellAlignment = 4
.TextMatrix(0, 0) = "编号"
.TextMatrix(0, 1) = "题目"
.TextMatrix(0, 2) = "作者"
.TextMatrix(0, 3) = "字数"
.TextMatrix(0, 4) = "刊物名称"
.TextMatrix(0, 5) = "级别"
.TextMatrix(0, 6) = "出版社"
.TextMatrix(0, 7) = "出版日期"
.TextMatrix(0, 8) = "页码"
Do While Not mrc.EOF
.Rows = .Rows + 1
.CellAlignment = 4
.TextMatrix(.Rows - 1, 0) = "" & mrc.Fields(0)
.TextMatrix(.Rows - 1, 1) = "" & mrc.Fields(1)
.TextMatrix(.Rows - 1, 2) = "" & mrc.Fields(2)
.TextMatrix(.Rows - 1, 3) = "" & mrc.Fields(3)
.TextMatrix(.Rows - 1, 4) = "" & mrc.Fields(4)
.TextMatrix(.Rows - 1, 5) = "" & mrc.Fields(5)
.TextMatrix(.Rows - 1, 6) = "" & mrc.Fields(6)
.TextMatrix(.Rows - 1, 7) = "" & Format(mrc.Fields(7), "yyyy-mm-dd")
.TextMatrix(.Rows - 1, 8) = "" & mrc.Fields(8)
'移动到下一条记录
mrc.MoveNext
Loop
End With
mrc.Close
End If
End If
End Sub
Private Sub Command1_Click()
tt = tt Mod 2
If tt = 1 Then
Label1.Visible = False
Else
Label1.Visible = True
End If
tt = tt + 1
End Sub
'初始化网格
Private Sub Form_Load()
tt = 0
Label1.Visible = False
With myflexgrid
.ColWidth(0) = 900
.ColWidth(1) = 1100
.ColWidth(2) = 800
.ColWidth(3) = 700
.ColWidth(4) = 1500
.ColWidth(5) = 700
.ColWidth(6) = 1500
.ColWidth(7) = 1000
.ColWidth(8) = 800
' ''''''''''''''''''''''''''''''''''''''''''''''''''''''''
.CellAlignment = 4
.TextMatrix(0, 0) = "编号"
.TextMatrix(0, 1) = "题目"
.TextMatrix(0, 2) = "作者"
.TextMatrix(0, 3) = "字数"
.TextMatrix(0, 4) = "刊物名称"
.TextMatrix(0, 5) = "级别"
.TextMatrix(0, 6) = "出版社"
.TextMatrix(0, 7) = "出版日期"
.TextMatrix(0, 8) = "页码"
End With
For i = 0 To 1
Cbo_Category(i).AddItem "编号"
Cbo_Category(i).AddItem "名称"
Cbo_Category(i).AddItem "主持人"
Cbo_Category(i).AddItem "完成情况"
Cbo_Category(i).AddItem "开始日期"
Cbo_Category(i).AddItem "完成日期"
Cbo_Category(i).ListIndex = 0
Cbo_Operator(i).ListIndex = 0
Next i
For i = 2 To 3
Cbo_Category(i).AddItem "编号"
Cbo_Category(i).AddItem "题目"
Cbo_Category(i).AddItem "作者"
Cbo_Category(i).AddItem "刊物名称"
Cbo_Category(i).AddItem "级别"
Cbo_Category(i).AddItem "出版社"
Cbo_Category(i).AddItem "出版日期"
Cbo_Category(i).ListIndex = 0
Cbo_Operator(i).ListIndex = 0
Next i
Cbo_Cate.AddItem "相关人姓名"
Cbo_Oper.AddItem "LIKE"
Cbo_Oper.AddItem "="
Cbo_Cate.ListIndex = 0
Cbo_Oper.ListIndex = 0
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -