以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  SQLJoinTableBuilder 的 filter  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=148466)

--  作者:tld
--  发布时间:2020/4/8 14:59:00
--  SQLJoinTableBuilder 的 filter
老师好。您帮我看看下面的代码哪里错误?谢谢了!

Dim name_fk As String
name_fk= e.Form.Controls("ComboBox1").value
Dim jb As new SQLJoinTableBuilder("mxb","流水")
jb.C onnection Name = "ph"
jb.addtable("流水","委托编号","付款开票明细","委托编号",JoinModeEnum.left)
jb.addcols("{流水}.日期","{流水}.委托编号","{流水}.委托单位","{流水}.委托人","{流水}.付款单位","{流水}.付款人","{流水}.核定价格","{流水}.是否含税"," {流水}.税后核定","{流水}.核价人")
jb.addcols("付款id","发票id","付款状态","开票状态","{流水}.检测_内容","{流水}.币种")
jb.Filter = "付款单位=\'" & name_fk & "\'"
Dim tb2 As Table = Tables("付款开票明细_table2")
tb2.Fill(jb.BuildSql,"ph",True)

运行到 filter 时发生错误。

而上面的代码 删除 jb.Filter = "付款单位=\'" & name_fk & "\'"后,改为tb2.Filter = "付款单位=\'" & name_fk & "\'"  一切正常

图片点击可在新窗口打开查看此主题相关图片如下:捕获.png
图片点击可在新窗口打开查看

[此贴子已经被作者于2020/4/8 15:01:53编辑过]

--  作者:有点蓝
--  发布时间:2020/4/8 15:45:00
--  
试试

jb.Filter = "{流水}.付款单位=\'" & name_fk & "\'"