以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  【求助】移动开发table 定义主键  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=120789)

--  作者:linyunu
--  发布时间:2018/6/23 22:20:00
--  【求助】移动开发table 定义主键
这样的要怎么样设置主键

With wb.AddTable("","Table1")
    .Highlight = 1  \'关闭高亮显示功能
    Dim nms() As String = {"单号","客户","状态","时间"}
    .Head.AddRow(nms)
    For Each r As DataRow In dt.Select("fblnCancel = 0 And 备货人 = \'\'","单号")
        .Body.AddRow(r("单号"),r("客户"),"备货中",r("fdtmCreateTime"))
    Next
    For Each r1 As DataRow In dt.Select("fblnCancel = 0 And 备货人 > \'\' And fblnDB = 0 And 送货人 = \'\'","单号")
        .Body.AddRow(r1("单号"),r1("客户"),"已备货",r1("fdtmJhrDate"))
    Next
    For Each r2 As DataRow In dt.Select("fblnCancel = 0 And 送货人 > \'\' And fblnOvPr = 0","单号")
        .Body.AddRow(r2("单号"),r2("客户"),"送货中",r2("fdtmJhrDate1"))
    Next
    For Each r3 As DataRow In dt.Select("fblnCancel = 0 And fblnDB = 1 And 送货人 = \'\'","单号")
        .Body.AddRow(r3("单号"),r3("客户"),"已打包",r3("fdtmJhrDate3"))
    Next
    For Each r4 As DataRow In dt.Select("fblnCancel = 0 And fblnOvPr = 1 ","单号")
        .Body.AddRow(r4("单号"),r4("客户"),"已送达",r4("fdtmJhrDate2"))
    Next
End With


--  作者:linyunu
--  发布时间:2018/6/24 17:40:00
--  
        With .Body.AddRow(r("单号"),r("客户"),"备货中",r("fdtmCreateTime"))
            .Primarykey = r("单号")
        End With

这样设置了也不行

--  作者:有点色
--  发布时间:2018/6/24 20:30:00
--  
以下是引用linyunu在2018/6/24 17:40:00的发言:
        With .Body.AddRow(r("单号"),r("客户"),"备货中",r("fdtmCreateTime"))
            .Primarykey = r("单号")
        End With

这样设置了也不行

 

这样写绝对没问题。不然你做个例子说明你具体什么问题。