以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 求助:代码在ACC数据库有效在SQL数据库无效 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=131350) |
-- 作者:刘异 -- 发布时间:2019/2/23 23:51:00 -- 求助:代码在ACC数据库有效在SQL数据库无效 老师好:下列代码用在SQL数据库中无效,在ACC中有效,不知道怎么改?多谢! If e.DataCol.Name = "内部订单号" OrElse e.DataCol.name = "计划加工工序" Then Dim ls As List(of String) = DataTables("生产进度扫描表").GetValues("加工工序", "内部订单号 = \'" & e.DataRow("内部订单号") & "\'") Dim str As String = "" Dim str1 As String = "" For Each s As String In e.DataRow("计划加工工序").split(",") If ls.Contains(s) Then str &= s & "," ls.Remove(s) Else str1 &= s & "," End If Next Dim str2 As String = String.join(",", ls.ToArray) str &= str2 e.DataRow("已加工工序") = str.trim(",") If e.DataRow("已加工工序") = Nothing Then \'e.DataRow("加工工序_实际增加的工序") = Nothing e.DataRow("未加工工序") = Nothing Else \'e.DataRow("加工工序_实际增加的工序") = str2.trim(",") e.DataRow("未加工工序") = str1.trim(",") End If End If Select Case e.DataCol.Name Case "计划加工工序" Dim ls11 As List(of String) = DataTables("生产进度扫描表").GetValues("工序数量描述", "内部订单号 = \'" & e.DataRow("内部订单号") & "\'") Dim str11 As String = "" Dim str111 As String = "" Dim str211 As String = String.join(",", ls11.ToArray) str11 &= str211 e.DataRow("进度描述") = str11.trim(",") End Select |
-- 作者:刘异 -- 发布时间:2019/2/24 0:10:00 -- 估计是我的表格有问题,我再检查一下 |
-- 作者:有点甜 -- 发布时间:2019/2/24 13:09:00 --
加入msgbox测试,看各个地方弹出的值,是不是你预想的值。
|