以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  SQL相关,不可保存编码-提示字符常量必须以双引号结束  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=18999)

--  作者:jinruan
--  发布时间:2012/4/24 16:02:00
--  SQL相关,不可保存编码-提示字符常量必须以双引号结束
如下编码保存时提示:

图片点击可在新窗口打开查看此主题相关图片如下:qq截图20120424155604.jpg
图片点击可在新窗口打开查看

\'狐表帮助中示例语句: Tables("窗口1_Table1").Fill("Select * From 订单 Where 日期 = \'" & Date.Today & "\'","nwnd",True)
1. jr_zb为外部数据源名
2.dbo.fun_GetTelReplyIntro为自定义函数
3.SQL语句运行在数据库查询分析器中运行是正常的

Tables("客户统计_Table1").Fill("
Select   a.ord, a.name,c.sort2,d.menuname,a.address,a.phone,a.fax,a.zdy1,a.zdy2,a.zdy3,a.zdy4,e.name,e.mobile,e.mobile2 ,  dbo.fun_GetTelReplyIntro(a.ord),a.email    from   tel a left JOIN   reply b on 1=1
    left JOIN   sort5 c on c.id=a.sort1
    left JOIN   menuarea d on d.id=a.area
    left join   person e on e.ord=a.person
    group by a.ord, a.name,c.sort2,d.menuname,a.address,a.phone,a.fax,a.zdy1,a.zdy2,a.zdy3,a.zdy4,e.name,e.mobile,e.mobile2 ,  dbo.fun_GetTelReplyIntro(a.ord),a.email ","jr_zb",True)

--  作者:狐狸爸爸
--  发布时间:2012/4/24 16:24:00
--  

Tables("客户统计_Table1").Fill("Select   a.ord, a.name,c.sort2,d.menuname,a.address,a.phone,a.fax," _
& " a.zdy1,a.zdy2,a.zdy3,a.zdy4,e.name,e.mobile,e.mobile2 ,  dbo.fun_GetTelReplyIntro(a.ord),a.email" _ 
& "  from   tel a left JOIN   reply b on 1=1    left JOIN   sort5 c on c.id=a.sort1 "  _
& "  left JOIN   menuarea d on d.id=a.area  left join   person e on e.ord=a.person"  _
& "  group by a.ord, a.name,c.sort2,d.menuname,a.address,a.phone,a.fax,a.zdy1,a.zdy2," _
& "a.zdy3,a.zdy4,e.name,e.mobile,e.mobile2 ,  dbo.fun_GetTelReplyIntro(a.ord),a.email ","jr_zb",True)

 


--  作者:jinruan
--  发布时间:2012/4/24 16:30:00
--  
SQL语句过长,还有这个窍门
执行OK
谢谢狐爸!