以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]SQL多表查询表DataTables().Load 出错  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=19999)

--  作者:zhangqinyun
--  发布时间:2012/5/26 16:08:00
--  [求助]SQL多表查询表DataTables().Load 出错

打开窗口 AfterLoad代码

t1.Fill("Select {BOM}.*,名称,单位 From {BOM} Left Join {物料} On {BOM}.原料ID = {物料}.物料ID Where [_Identify] Is Null",_UserCompany,True)
t1.SetColVisibleWidth("物料ID|70|原料ID|70|名称|150|位置|150|用量|60|单位|40|说明|100|录入人|60|日期|70")
t1.DataTable.DataCols("用量").SetFormat("0.0000")

 

打开窗口后,执行以下代码出错

DataTables("BOM管理_Table1").LoadFilter = "物料ID=\'" & e.From.Controls("物料ID").Value & "\'"
DataTables("BOM管理_Table1").Load

 

提示特定字段"物料ID“,参考SQL中From多表

 

这个怎么解决???


--  作者:sloyy
--  发布时间:2012/5/26 22:47:00
--  
我的经验:  &后面多加一个空格 它就不出错了
--  作者:狐狸爸爸
--  发布时间:2012/5/28 8:46:00
--  

多表查询就不要用Load吧,继续用Fill