Foxtable(狐表)用户栏目专家坐堂 → 加载数据表


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

主题:加载数据表

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


加好友 发短信
等级:四尾狐 帖子:929 积分:6500 威望:0 精华:0 注册:2014/6/25 10:48:00
加载数据表  发帖心情 Post By:2020/4/20 9:25:00 [只看该作者]

老师,打开项目提示“加载数据表|123失败”,详细错误信息:
System.data.OleDb.OleDbException:无法完成延迟准备。
无法预定义语句。
列名‘zw’不明确。
。。。。
。。。。。


很多信息。
在上一次打开项目是没有这个信息的。
输出全部代码查找,没有涉及“123”的代码,在表列表里也没有找到表“|123".前两次打开项目倒是看到过123的表,但今天打开找不到,请问是怎么回事呢,怎么解决??
[此贴子已经被作者于2020/4/20 9:47:15编辑过]

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


加好友 发短信
等级:四尾狐 帖子:929 积分:6500 威望:0 精华:0 注册:2014/6/25 10:48:00
  发帖心情 Post By:2020/4/20 9:44:00 [只看该作者]

下面代码中没有以”True“为列名的,但在重置列时提示运行错误。上一次打开都没有这么多错语,怎么今天打开就这么多错误呢?请老师帮忙,谢谢(老师,下面代码不提示错误了,但不提示错误,也不计算数据。。。。)
.NET Framework 版本:2.0.50727.8806
Foxtable 版本:2017.6.12.1
错误所在事件:
详细错误信息:
列名 'True' 无效。


Dim y As Integer = Date.Today.Year
Dim w As Integer = Date.Today.DayOfWeek '算出今天是星期几
Dim m As Integer = Date.Today.Month
Dim dt1 As Date = Date.Today '获取今天的日期

Dim dt5 As Date = Date.Today.AddDays(-w) '获取本周的第一天
Dim dt6 As Date = Date.Today.AddDays(6 - w) '获取本周的最后一天
Dim dt7 As New Date(y, m, 1)
Dim dt8 As New Date(y, m, Date.DaysInMonth(y, m)) '获取本月的最后一天
Dim q As Integer = (Date.Today.Month - 1) \ 3 + 1 '计算现在是第几个季度
Dim dt11 As New Date(y, 3 * (q - 1) + 1, 1) '获取本季度的第一天
Dim dt12 As New Date(y, 3 * q, Date.DaysInMonth(y,3 * q)) '获取本季度的最后一天
Dim dt13 As New Date(y, 1, 1)
Dim dt14 As New Date(y, 12, 31)
If e.DataCol.Name = "单位简称" Then  
    Dim filter1 As String = "单位简称 = '" & e.DataRow("单位简称")  & "'"
    e.DataRow("本周本金2") = DataTables("hbfxjhb").sqlCompute("sum(hbje)",filter1 & "And [rq] >= '" & dt5 & "'And [rq] <= '" & dt6 & "'and [hbje] > 0 ")
    e.DataRow("本周本金4") = DataTables("hbmxb").sqlCompute("sum(hkje)",filter1 & "And [rq] >= '" & dt5 & "'And [rq] <= '" & dt6 & "'")/10000
    e.DataRow("本周利息2") = DataTables("hbfxjhb").sqlCompute("sum(fxje)",filter1 & "And [rq] >= '" & dt5 & "'And [rq] <= '" & dt6 & "'")
    e.DataRow("本周利息4") = DataTables("lxmxb").sqlCompute("sum(zfje)",filter1 & "And [rq] >= '" & dt5 & "'And [rq] <= '" & dt6 & "'")/10000
    e.DataRow("本周piao据2") = DataTables("pjmxb").sqlCompute("sum(开piao金额)",filter1 & "And [到期日期] >= '" & dt5 & "'And [到期日期] <= '" & dt6 & "'")/10000
    e.DataRow("本周piao据4") = DataTables("pjmxb").sqlCompute("sum(开piao金额)",filter1 & "And [到期日期] >= '" & dt5 & "'And [到期日期] <= '" & dt6 & "'and [兑付] = True ")/10000

    e.DataRow("本月本金2") = DataTables("hbfxjhb").sqlCompute("sum(hbje)",filter1 & "And [rq] >= '" & dt7 & "'And [rq] <= '"  & dt8 & "'and [hbje] > 0 ")
    e.DataRow("本月本金4") = DataTables("hbmxb").sqlCompute("sum(hkje)",filter1 & "And [rq] >= '" & dt7 & "'And [rq] <= '"  & dt8 & "'")/10000
    e.DataRow("本月利息2") = DataTables("hbfxjhb").sqlCompute("sum(fxje)",filter1 & "And [rq] >= '" & dt7 & "'And [rq] <= '"  & dt8 & "'")
    e.DataRow("本月利息4") = DataTables("lxmxb").sqlCompute("sum(zfje)",filter1 & "And [rq] >= '" & dt7 & "'And [rq] <= '"  & dt8 & "'")/10000
    e.DataRow("本月piao据2") = DataTables("pjmxb").sqlCompute("sum(开piao金额)",filter1 & "And [到期日期] >= '" & dt7 & "'And [到期日期] <= '"  & dt8 & "'")/10000
    e.DataRow("本月piao据4") = DataTables("pjmxb").sqlCompute("sum(开piao金额)",filter1 & "And [到期日期] >= '" & dt7 & "'And [到期日期] <= '"  & dt8 & "'and [兑付] = True ")/10000

    e.DataRow("本季本金2") = DataTables("hbfxjhb").sqlCompute("sum(hbje)",filter1 & "And [rq] > '" & dt11 & "'And [rq] <= '" & dt12 & "'")
    e.DataRow("本季本金4") = DataTables("hbmxb").sqlCompute("sum(hkje)",filter1 & "And [rq] > '" & dt11 & "'And [rq] <= '" & dt12 & "'")/10000
    e.DataRow("本季利息2") = DataTables("hbfxjhb").sqlCompute("sum(hbje)",filter1 & "And [rq] > '" & dt11 & "'And [rq] <= '" & dt12 & "'")
    e.DataRow("本季利息4") = DataTables("lxmxb").sqlCompute("sum(zfje)",filter1 & "And [rq] > '" & dt11 & "'And [rq] <= '" & dt12 & "'")/10000
    e.DataRow("本季piao据2") = DataTables("pjmxb").sqlCompute("sum(开piao金额)",filter1 & "And [到期日期] > '" & dt11 & "'And [到期日期] <= '" & dt12 & "'")/10000
    e.DataRow("本季piao据2") = DataTables("pjmxb").sqlCompute("sum(开piao金额)",filter1 & "And [到期日期] > '" & dt11 & "'And [到期日期] <= '" & dt12 & "'and [兑付] = True ")/10000

    e.DataRow("本年本金2") = DataTables("hbfxjhb").sqlCompute("sum(hbje)",filter1 & "And [rq] > '" & dt13 & "'And [rq] <= '" & dt14 & "'")
    e.DataRow("本年本金4") = DataTables("hbmxb").sqlCompute("sum(hkje)",filter1 & "And [rq] > '" & dt13 & "'And [rq] <= '" & dt14 & "'")/10000
    e.DataRow("本年利息2") = DataTables("hbfxjhb").sqlCompute("sum(hbje)",filter1 & "And [rq] > '" & dt13 & "'And [rq] <= '" & dt14 & "'")
    e.DataRow("本年利息4") = DataTables("lxmxb").sqlCompute("sum(zfje)",filter1 & "And [rq] > '" & dt13 & "'And [rq] <= '" & dt14 & "'")/10000
    e.DataRow("本年piao据2") = DataTables("pjmxb").sqlCompute("sum(开piao金额)",filter1 & "And [到期日期] > '" & dt13 & "'And [到期日期] <= '" & dt14 & "'")/10000
    e.DataRow("本年piao据4") = DataTables("pjmxb").sqlCompute("sum(开piao金额)",filter1 & "And [到期日期] > '" & dt13 & "'And [到期日期] <= '" & dt14 & "'and [兑付] = True ")/10000
End If
[此贴子已经被作者于2020/4/20 10:52:59编辑过]

 回到顶部
帅哥,在线噢!
有点蓝
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106664 积分:542503 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/4/20 10:07:00 [只看该作者]

应该是某个查询表加载有问题,查询表引用的表可能改列名了,列名‘zw’不存在

 回到顶部
帅哥哟,离线,有人找我吗?
爱相随
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:929 积分:6500 威望:0 精华:0 注册:2014/6/25 10:48:00
  发帖心情 Post By:2020/4/20 10:26:00 [只看该作者]

哦,l123表是查询表,删除后就没有提示加载失败了,谢谢老师
[此贴子已经被作者于2020/4/20 10:29:13编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
爱相随
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:929 积分:6500 威望:0 精华:0 注册:2014/6/25 10:48:00
  发帖心情 Post By:2020/4/20 11:25:00 [只看该作者]

老师,在表属性里代码运行中”列名无效“是怎么回事呢??

 回到顶部
帅哥哟,离线,有人找我吗?
爱相随
  6楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:929 积分:6500 威望:0 精华:0 注册:2014/6/25 10:48:00
  发帖心情 Post By:2020/4/20 12:01:00 [只看该作者]

哪位老师帮我看看代码,为什么就不计算或计不正确呢。。。。。

Dim y As Integer = Date.Today.Year
Dim w As Integer = Date.Today.DayOfWeek '算出今天是星期几
Dim m As Integer = Date.Today.Month
Dim dt1 As Date = Date.Today '获取今天的日期
Dim dt5 As Date = Date.Today.AddDays(-w) '获取本周的第一天
Dim dt6 As Date = Date.Today.AddDays(6 - w) '获取本周的最后一天
Dim dt7 As New Date(y, m, 1)
Dim dt8 As New Date(y, m, Date.DaysInMonth(y, m)) '获取本月的最后一天
Dim q As Integer = (Date.Today.Month - 1) \ 3 + 1 '计算现在是第几个季度
Dim dt11 As New Date(y, 3 * (q - 1) + 1, 1) '获取本季度的第一天
Dim dt12 As New Date(y, 3 * q, Date.DaysInMonth(y,3 * q)) '获取本季度的最后一天
Dim dt13 As New Date(y, 1, 1)
Dim dt14 As New Date(y, 12, 31)
If e.DataCol.Name = "单位简称" Then  
    Dim filter1 As String = "单位简称 = '" & e.DataRow("单位简称")  & "'"
    e.DataRow("本周本金1") = DataTables("hbfxjhb").Compute("Count(_Identify)" ,filter1 & "And [rq] >= '" & dt5 & "'And [rq] <= '" & dt6 & "'And [hbje] > 0 ")
    e.DataRow("本周本金2") = DataTables("hbfxjhb").Compute("sum(hbje)" ,filter1 & "And [rq] >= '" & dt5 & "'And [rq] <= '" & dt6 & "'")
    e.DataRow("本周本金3") = DataTables("hbmxb").Compute("Count(_Identify)",filter1 & "And [rq] >= '" & dt5 & "'And [rq] <= '" & dt6 & "'")
    e.DataRow("本周本金4") = DataTables("hbmxb").Compute("sum(hkje)",filter1 & "And [rq] >= '" & dt5 & "'And [rq] <= '" & dt6 & "'")/10000
    e.DataRow("本周本金6") = DataTables("xzfkmxb").Compute("Count(_Identify)",filter1 & "And [rq] >= '" & dt5 & "'And [rq] <= '" & dt6 & "'")
    e.DataRow("本周本金5") = DataTables("xzfkmxb").Compute("sum(byfk)",filter1 & "And [rq] >= '" & dt5 & "'And [rq] <= '" & dt6 & "'")/10000
    e.DataRow("本周利息1") = DataTables("hbfxjhb").Compute("Count(_Identify)",filter1 & "And [rq] >= '" & dt5 & "'And [rq] <= '" & dt6 & "'And [fxje] > 0 ")
    e.DataRow("本周利息2") = DataTables("hbfxjhb").Compute("sum(fxje)",filter1 & "And [rq] >= '" & dt5 & "'And [rq] <= '" & dt6 & "'")
    e.DataRow("本周利息3") = DataTables("lxmxb").Compute("Count(_Identify)",filter1 & "And [rq] >= '" & dt5 & "'And [rq] <= '" & dt6 & "'")
    e.DataRow("本周利息4") = DataTables("lxmxb").Compute("sum(zfje)",filter1 & "And [rq] >= '" & dt5 & "'And [rq] <= '" & dt6 & "'")/10000
    e.DataRow("本周piao据2") = DataTables("pjmxb").Compute("sum(开piao金额)",filter1 & "And [到期日期] >= '" & dt5 & "'And [到期日期] <= '" & dt6 & "'")/10000
    e.DataRow("本周piao据4") = DataTables("pjmxb").Compute("sum(开piao金额)",filter1 & "And [到期日期] >= '" & dt5 & "'And [到期日期] <= '" & dt6 & "'and [兑付] = 'True' ")/10000
    e.DataRow("本周piao据5") = DataTables("pjmxb").Compute("Count(_Identify)",filter1 & "And [出piao日期] >= '" & dt5 & "'And [出piao日期] <= '" & dt6 & "'")
    e.DataRow("本周piao据6") = DataTables("pjmxb").Compute("sum(开piao金额)",filter1 & "And [出piao日期] >= '" & dt5 & "'And [出piao日期] <= '" & dt6 & "'")/10000

    e.DataRow("本月本金1") = DataTables("hbfxjhb").sqlCompute("Count(_Identify)",filter1 & "And [rq] >= '" & dt7 & "'And [rq] <= '" & dt8 & "'And [hbje] > 0 ")
    e.DataRow("本月本金2") = DataTables("hbfxjhb").sqlCompute("sum(hbje)",filter1 & "And [rq] >= '" & dt7 & "'And [rq] <= '"  & dt8 & "'")
    e.DataRow("本月本金3") = DataTables("hbmxb").sqlCompute("Count(_Identify)",filter1 & "And [rq] >= '" & dt7 & "'And [rq] <= '" & dt8 & "'")
    e.DataRow("本月本金4") = DataTables("hbmxb").sqlCompute("sum(hkje)",filter1 & "And [rq] >= '" & dt7 & "'And [rq] <= '"  & dt8 & "'")/10000
    e.DataRow("本月本金6") = DataTables("xzfkmxb").sqlCompute("Count(_Identify)",filter1 & "And [rq] >= '" & dt7 & "'And [rq] <= '" & dt8 & "'")
    e.DataRow("本月本金5") = DataTables("xzfkmxb").sqlCompute("sum(byfk)",filter1 & "And [rq] >= '" & dt7 & "'And [rq] <= '" & dt8 & "'")/10000
    e.DataRow("本月利息1") = DataTables("hbfxjhb").sqlCompute("Count(_Identify)",filter1 & "And [rq] >= '" & dt7 & "'And [rq] <= '" & dt8 & "'And [fxje] > 0 ")
    e.DataRow("本月利息2") = DataTables("hbfxjhb").sqlCompute("sum(fxje)",filter1 & "And [rq] >= '" & dt7 & "'And [rq] <= '"  & dt8 & "'")
    e.DataRow("本月利息3") = DataTables("lxmxb").sqlCompute("Count(_Identify)",filter1 & "And [rq] >= '" & dt7 & "'And [rq] <= '" & dt8 & "'")
    e.DataRow("本月利息4") = DataTables("lxmxb").sqlCompute("sum(zfje)",filter1 & "And [rq] >= '" & dt7 & "'And [rq] <= '"  & dt8 & "'")/10000
    e.DataRow("本月piao据2") = DataTables("pjmxb").sqlCompute("sum(开piao金额)",filter1 & "And [到期日期] >= '" & dt7 & "'And [到期日期] <= '"  & dt8 & "'")/10000
    e.DataRow("本月piao据4") = DataTables("pjmxb").sqlCompute("sum(开piao金额)",filter1 & "And [到期日期] >= '" & dt7 & "'And [到期日期] <= '"  & dt8 & "'and [兑付] = 'True' ")/10000
    e.DataRow("本月piao据5") = DataTables("pjmxb").sqlCompute("Count(_Identify)",filter1 & "And [出piao日期] >= '" & dt7 & "'And [出piao日期] <= '" & dt8 & "'")
    e.DataRow("本月piao据6") = DataTables("pjmxb").sqlCompute("sum(开piao金额)",filter1 & "And [出piao日期] >= '" & dt7 & "'And [出piao日期] <= '" & dt8 & "'")/10000

    e.DataRow("本季本金2") = DataTables("hbfxjhb").sqlCompute("sum(hbje)",filter1 & "And [rq] > '" & dt11 & "'And [rq] <= '" & dt12 & "'")
    e.DataRow("本季本金4") = DataTables("hbmxb").sqlCompute("sum(hkje)",filter1 & "And [rq] > '" & dt11 & "'And [rq] <= '" & dt12 & "'")/10000
    e.DataRow("本季利息2") = DataTables("hbfxjhb").sqlCompute("sum(hbje)",filter1 & "And [rq] > '" & dt11 & "'And [rq] <= '" & dt12 & "'")
    e.DataRow("本季利息4") = DataTables("lxmxb").sqlCompute("sum(zfje)",filter1 & "And [rq] > '" & dt11 & "'And [rq] <= '" & dt12 & "'")/10000
    e.DataRow("本季piao据2") = DataTables("pjmxb").sqlCompute("sum(开piao金额)",filter1 & "And [到期日期] > '" & dt11 & "'And [到期日期] <= '" & dt12 & "'")/10000
    e.DataRow("本季piao据2") = DataTables("pjmxb").sqlCompute("sum(开piao金额)",filter1 & "And [到期日期] > '" & dt11 & "'And [到期日期] <= '" & dt12 & "'and [兑付] = 'True' ")/10000

    e.DataRow("本年本金2") = DataTables("hbfxjhb").sqlCompute("sum(hbje)",filter1 & "And [rq] > '" & dt13 & "'And [rq] <= '" & dt14 & "'")
    e.DataRow("本年本金4") = DataTables("hbmxb").sqlCompute("sum(hkje)",filter1 & "And [rq] > '" & dt13 & "'And [rq] <= '" & dt14 & "'")/10000
    e.DataRow("本年利息2") = DataTables("hbfxjhb").sqlCompute("sum(hbje)",filter1 & "And [rq] > '" & dt13 & "'And [rq] <= '" & dt14 & "'")
    e.DataRow("本年利息4") = DataTables("lxmxb").sqlCompute("sum(zfje)",filter1 & "And [rq] > '" & dt13 & "'And [rq] <= '" & dt14 & "'")/10000
    e.DataRow("本年piao据2") = DataTables("pjmxb").sqlCompute("sum(开piao金额)",filter1 & "And [到期日期] > '" & dt13 & "'And [到期日期] <= '" & dt14 & "'")/10000
    e.DataRow("本年piao据4") = DataTables("pjmxb").sqlCompute("sum(开piao金额)",filter1 & "And [到期日期] > '" & dt13 & "'And [到期日期] <= '" & dt14 & "'and [兑付] = 'True' ")/10000
End If

 回到顶部
帅哥,在线噢!
有点蓝
  7楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106664 积分:542503 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/4/20 12:03:00 [只看该作者]

提示什么错误?如果没有错误肯定就是没有符合条件的数据,或者数据没有保存。

Compute都改为sqlCompute

 回到顶部