以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  列名 'True' 无效。  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=154195)

--  作者:swagger
--  发布时间:2020/9/7 18:10:00
--  列名 'True' 无效。
跨表引用或者跨表更新 逻辑列 会出现这个问题。

譬如 

If e.DataCol.Name = "产品编号" Then
    Dim
nms() As String = {"品名","型号","规格","合格"}
    If
e.NewValue Is Nothing Then

        For
Each nm As String In nms

            e
.DataRow(nm) = Nothing

        Next

    Else

        Dim
dr As DataRow

        dr
= DataTables("产品").SQLFind("[产品编号] = \'" & e.NewValue &
"\'")
        If
dr IsNot Nothing
            For Each
nm As String In nms
               
e.DataRow(nm) = dr(nm)
            Next
        End If
    End If
End If


或者


Select Case e.DataCol.Name
    Case
"品名","型号","规格",
"合格"
       
Dim Filter As String = "[产品编号] = \'" & e.DataRow("产品编号") & "\'"
        DataTables("订单").ReplaceFor(e.DataCol.Name, e.NewValue, Filter)

        DataTables("订单").SQLReplaceFor(e.DataCol.Namee.NewValueFilter)
End Select



上述该怎么写呢?


--  作者:有点蓝
--  发布时间:2020/9/7 20:18:00
--  
如果是SqlServer,看看:http://www.foxtable.com/webhelp/topics/2343.htm