Foxtable(狐表)用户栏目专家坐堂 → SQLJoinTableBuilder 数据源问题


  共有1797人关注过本帖树形打印复制链接

主题:SQLJoinTableBuilder 数据源问题

帅哥哟,离线,有人找我吗?
pizzahe
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:童狐 帖子:287 积分:2921 威望:0 精华:0 注册:2015/12/21 13:35:00
SQLJoinTableBuilder 数据源问题  发帖心情 Post By:2018/12/16 18:02:00 [只看该作者]

这个工具,从ACC数据源改成SQL数据源出错了,怎么解决

Dim jb As New SQLJoinTableBuilder("查询表1","YF_ChargeDetails")
jb.ConnectionName = dataName
jb.AddTable("YF_ChargeDetails","roomID","YF_room","ID")
jb.AddTable("YF_ChargeDetails","rentID","YF_rent","ID")

jb.AddCols("roomName as 房间名称" ,"roomType as 房间类型","custName as 客户名称","Tell as 电话","{YF_ChargeDetails}.addDate as 收费日期","Serial as 流水号","Startdate as 开始日期","Enddate as 结束日期","freeType as 费用类型","ChargeType as 收费类型","payment as 收款方式","freeName as 费用名称","price as 费用单价","shuliang as 数量周期","xiaoji as 费用小计","State as 费用状态","beizhu as 备注")



With Tables(e.Form.Name & "_Table1")

' Dim nf As String = Forms("工作主窗口").Controls("TJ_年份").Value
Dim year As Integer = 2018 'nf.Split(" ")(0)
Dim FirstDay As Date = New Date(year ,1,1) '第一天
Dim LastDay As Date = New Date(year ,12 ,Date.DaysInMonth(year ,12 ))
jb.Filter = "YF_ChargeDetails.addDate >= #" & FirstDay & "# and YF_ChargeDetails.addDate <= #" & LastDay & "#"
MessageBox.Show(jb.BuildSql)
.Fill(jb.BuildSql,dataName ,True)
Functions.Execute("TableDrow",.Name)
.AutoSizeCols(10)
End With


 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/12/16 18:17:00 [只看该作者]

把这句删除,是否还报错?

 

jb.Filter = "YF_ChargeDetails.addDate >= #" & FirstDay & "# and YF_ChargeDetails.addDate <= #" & LastDay & "#"

 

 


 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/12/16 20:08:00 [只看该作者]

把生成的sql语句弄出来尝试,如

 

output.show(jb.BuildSql)

msgbox(jb.BuildSql)


 回到顶部