以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  此段代码有问题  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=7047)

--  作者:lpxjw_zyl
--  发布时间:2010/5/10 10:10:00
--  此段代码有问题
for i as Integer = 0 to DataTables("中招报名").Datarows.count - 1
    for each dc as datacol in DataTables("中招报名").Datacols
        if DataTables("中招报名")(i)(dc.name) <> DataTables("中招报名5月10日")(i)(dc.name) then
            DataTables("中招报名5月10日")(h)("核对情况") = "数据有误"
            exit for
        end if
    next
next

--  作者:yangming
--  发布时间:2010/5/10 10:29:00
--  

for i as Integer = 0 to Tables("中招报名").rows.count - 1
    for each dc as col in Tables("中招报名").cols
        if Tables("中招报名")(i,dc.name) <> Tables("中招报名5月10日")(i,dc.name) then
            Tables("中招报名5月10日")(h,"核对情况") = "数据有误"
            exit for
        end if
    next
next

 

注意:红色的h是不是数字,不知道你是否在其它代码中定义过

这样才是正确的

 

for i as Integer = 0 to Tables("中招报名").rows.count - 1
    for each dc as col in Tables("中招报名").cols
        if Tables("中招报名")(i,dc.name) <> Tables("中招报名5月10日")(i,dc.name) then
            Tables("中招报名5月10日")(i,"核对情况") = "数据有误"
            exit for
        end if
    next
next

[此贴子已经被作者于2010-5-10 10:36:40编辑过]

--  作者:lpxjw_zyl
--  发布时间:2010/5/10 16:32:00
--  

谢谢