VB中按Access表中记录筛选数据
我做的是试题库系统我把选题条件(题型、题数、难度、知识点)存到一个表中,想按照这个表的内容从试题库表中筛选出合适的试题!!达到随机抽题的效果!!!谁能帮帮我啊!!谢谢了!...
我做的是试题库系统 我把选题条件(题型、题数、难度、知识点)存到一个表中,想按照这个表的内容 从试题库表中筛选出合适的试题!! 达到随机抽题的效果!!!谁能帮帮我啊!!谢谢了!
我找到得一段代码如下 但是始终都有问题
Dim i, j As Integer
Do While Not Data3.Recordset.EOF
If IsNull(Data3.Recordset.nandu) Then
If IsNull(Data3.Recordset.zhishidian) Then
Data2.RecordSource = "select*from 试题库 where (tag<>'1'or isnull(tag))" & "and trim(tixing)=" & Trim(Data3.Recordset.tixing)
Else
Data2.RecordSource = "selce*from 试题库 where(tag<>'1'or isnull(tag))" & "and trim(tixing)=" & Trim(Data3.Recordset.tixing) & "and trim(zhishidian)=" & Trim(Data3.Recordset.zhishidian)
End If
Else
If IsNull(Data3.Recordset.zhishidian) Then
Data2.RecordSource = "selce*from 试题库 where(tag<>'1'or isnull(tag))" & "and trim(tixing)=" & Trim(Data3.Recordset.tixing) & "and nandu=" & Trim(Data3.Recordset.nandu)
Else
Data2.RecordSource = "select*from 试题库 where(tag<>'1'or isnull(tag))" & "and trim(tixing)=" & Trim(Data3.Recordset.tixing) & "and trim(zhishidian)=" & Trim(Data3.Recordset.zhishidian) & "and nandu=" & Trim(Data3.Recordset.nandu) 展开
我找到得一段代码如下 但是始终都有问题
Dim i, j As Integer
Do While Not Data3.Recordset.EOF
If IsNull(Data3.Recordset.nandu) Then
If IsNull(Data3.Recordset.zhishidian) Then
Data2.RecordSource = "select*from 试题库 where (tag<>'1'or isnull(tag))" & "and trim(tixing)=" & Trim(Data3.Recordset.tixing)
Else
Data2.RecordSource = "selce*from 试题库 where(tag<>'1'or isnull(tag))" & "and trim(tixing)=" & Trim(Data3.Recordset.tixing) & "and trim(zhishidian)=" & Trim(Data3.Recordset.zhishidian)
End If
Else
If IsNull(Data3.Recordset.zhishidian) Then
Data2.RecordSource = "selce*from 试题库 where(tag<>'1'or isnull(tag))" & "and trim(tixing)=" & Trim(Data3.Recordset.tixing) & "and nandu=" & Trim(Data3.Recordset.nandu)
Else
Data2.RecordSource = "select*from 试题库 where(tag<>'1'or isnull(tag))" & "and trim(tixing)=" & Trim(Data3.Recordset.tixing) & "and trim(zhishidian)=" & Trim(Data3.Recordset.zhishidian) & "and nandu=" & Trim(Data3.Recordset.nandu) 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询