以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  匹配问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=103020)

--  作者:刘林
--  发布时间:2017/6/29 10:43:00
--  匹配问题
If e.DataCol.Name = "身份证件号"  Then
    If e.DataRow("年级") >= "8"
        Dim drs As DataRow
        If e.DataRow("身份证件号") IsNot Nothing
            drs = DataTables("生地报名库").sqlFind("left(报名号,2) = \'" & e.DataRow("年级代码") & "\' and 身份证号 = \'" & e.DataRow("身份证件号") & "\'" )
        Else
            drs = DataTables("生地报名库").sqlFind("级 = \'" & e.DataRow("班级全称") & "\' and 学校名称 = \'" & e.DataRow("单位名称") & "\' and 姓名 = \'" & e.DataRow("姓名") & "\'")
        End If
        If drs IsNot Nothing
            e.DataRow("生物_")= drs("生物")
            e.DataRow("地理_")= drs("地理")
        End If
    End If
End If

老师,你好,我在datachanged事件中,想实现当有身份证号用身份证号查找匹配,如果没有身份证号就有班级全称,学校名称,姓名匹配,现在是没身份证就没有匹配起,请问如何改?

--  作者:有点色
--  发布时间:2017/6/29 10:49:00
--  
If e.DataCol.Name = "身份证件号"  Then
    If e.DataRow("年级") >= "8"
        Dim drs As DataRow
        If e.DataRow("身份证件号") IsNot Nothing
            drs = DataTables("生地报名库").sqlFind("left(报名号,2) = \'" & e.DataRow("年级代码") & "\' and 身份证号 = \'" & e.DataRow("身份证件号") & "\'" )
        End If
        If drs Is Nothing Then
            drs = DataTables("生地报名库").sqlFind("级 = \'" & e.DataRow("班级全称") & "\' and 学校名称 = \'" & e.DataRow("单位名称") & "\' and 姓名 = \'" & e.DataRow("姓名") & "\'")
        End If
        If drs IsNot Nothing
            e.DataRow("生物_")= drs("生物")
            e.DataRow("地理_")= drs("地理")
        End If
    End If
End If