以文本方式查看主题

-  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=154536)

--  作者:gudao123456
--  发布时间:2020/9/17 16:59:00
--  这个代码问题在那?
要从一个表的数据读入另一个表,因发现有些记录未读入,写了个代码查找,并将查找的结果生成一个新表,并在原表中做个标记逻辑列:“核验没读入”,代码如下:

Dim q As new QueryBuilder
q.TableName = "未读入资助明细表名单"
q.Se lectString = "Se lect * from  {sqxxb} where (Se lect count(1) As num from {dxxsrxbzmxb} where {dxxsrxbzmxb}.sfzhm = {sqxxb}.身份证号码 ) = 0"
q.C
q.Build
\'MainTable = Tables("未读入资助明细表名单")
Dim dr As DataRow
Dim i As Integer
For Each r As Row In Tables("未读入资助明细表名单").Rows

    dr = DataTables("sqxxb").SQLFind("[身份证号码] = \'" & r("身份证号码") & "\'")
    If dr IsNot Nothing

      dr("核验没读入")=True
msgbox("1")
    End If
Next

但是   dr("核验没读入")=True 没有起作用,即没有打钩   msgbox("1")已经执行
不知何故,谢谢!

[此贴子已经被作者于2020/9/17 17:01:51编辑过]

--  作者:有点蓝
--  发布时间:2020/9/17 17:14:00
--  
没有保存
    If dr IsNot Nothing

      dr("核验没读入")=True
dr.save
msgbox("1")
    End If

--  作者:gudao123456
--  发布时间:2020/9/17 17:20:00
--  
哦,谢谢!
有些时候是退出时才要求是否储存盘退出,请问在什么情况下需要马上存盘保存,否则就没数据?谢谢
[此贴子已经被作者于2020/9/17 17:22:10编辑过]

--  作者:有点蓝
--  发布时间:2020/9/17 17:31:00
--  
凡是后台操作的方法都需要马上保存:http://www.foxtable.com/webhelp/topics/2902.htm
--  作者:gudao123456
--  发布时间:2020/9/17 21:24:00
--  
谢谢!