以文本方式查看主题 - Foxtable(狐表) (http://www.foxtable.com/bbs/index.asp) -- 专家坐堂 (http://www.foxtable.com/bbs/list.asp?boardid=2) ---- 加载数据表 (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=148964) |
-- 作者:爱相随 -- 发布时间:2020/4/20 9:25:00 -- 加载数据表 老师,打开项目提示“加载数据表|123失败”,详细错误信息: System.data.OleDb.OleDbException:无法完成延迟准备。 无法预定义语句。 列名‘zw’不明确。 在 。。。。 在 。。。。。 很多信息。 在上一次打开项目是没有这个信息的。 输出全部代码查找,没有涉及“123”的代码,在表列表里也没有找到表“|123".前两次打开项目倒是看到过123的表,但今天打开找不到,请问是怎么回事呢,怎么解决??
[此贴子已经被作者于2020/4/20 9:47:15编辑过]
|
-- 作者:爱相随 -- 发布时间: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("本周票据2") = DataTables("pjmxb").sqlCompute("sum(开票金额)",filter1 & "And [到期日期] >= \'" & dt5 & "\'And [到期日期] <= \'" & dt6 & "\'")/10000 e.DataRow("本周票据4") = DataTables("pjmxb").sqlCompute("sum(开票金额)",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("本月票据2") = DataTables("pjmxb").sqlCompute("sum(开票金额)",filter1 & "And [到期日期] >= \'" & dt7 & "\'And [到期日期] <= \'" & dt8 & "\'")/10000 e.DataRow("本月票据4") = DataTables("pjmxb").sqlCompute("sum(开票金额)",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("本季票据2") = DataTables("pjmxb").sqlCompute("sum(开票金额)",filter1 & "And [到期日期] > \'" & dt11 & "\'And [到期日期] <= \'" & dt12 & "\'")/10000 e.DataRow("本季票据2") = DataTables("pjmxb").sqlCompute("sum(开票金额)",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("本年票据2") = DataTables("pjmxb").sqlCompute("sum(开票金额)",filter1 & "And [到期日期] > \'" & dt13 & "\'And [到期日期] <= \'" & dt14 & "\'")/10000 e.DataRow("本年票据4") = DataTables("pjmxb").sqlCompute("sum(开票金额)",filter1 & "And [到期日期] > \'" & dt13 & "\'And [到期日期] <= \'" & dt14 & "\'and [兑付] = True ")/10000 End If
[此贴子已经被作者于2020/4/20 10:52:59编辑过]
|
-- 作者:有点蓝 -- 发布时间:2020/4/20 10:07:00 -- 应该是某个查询表加载有问题,查询表引用的表可能改列名了,列名‘zw’不存在 |
-- 作者:爱相随 -- 发布时间:2020/4/20 10:26:00 -- 哦,l123表是查询表,删除后就没有提示加载失败了,谢谢老师 [此贴子已经被作者于2020/4/20 10:29:13编辑过]
|
-- 作者:爱相随 -- 发布时间:2020/4/20 11:25:00 -- 老师,在表属性里代码运行中”列名无效“是怎么回事呢?? |
-- 作者:爱相随 -- 发布时间: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("本周票据2") = DataTables("pjmxb").Compute("sum(开票金额)",filter1 & "And [到期日期] >= \'" & dt5 & "\'And [到期日期] <= \'" & dt6 & "\'")/10000 e.DataRow("本周票据4") = DataTables("pjmxb").Compute("sum(开票金额)",filter1 & "And [到期日期] >= \'" & dt5 & "\'And [到期日期] <= \'" & dt6 & "\'and [兑付] = \'True\' ")/10000 e.DataRow("本周票据5") = DataTables("pjmxb").Compute("Count(_Identify)",filter1 & "And [出票日期] >= \'" & dt5 & "\'And [出票日期] <= \'" & dt6 & "\'") e.DataRow("本周票据6") = DataTables("pjmxb").Compute("sum(开票金额)",filter1 & "And [出票日期] >= \'" & dt5 & "\'And [出票日期] <= \'" & 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("本月票据2") = DataTables("pjmxb").sqlCompute("sum(开票金额)",filter1 & "And [到期日期] >= \'" & dt7 & "\'And [到期日期] <= \'" & dt8 & "\'")/10000 e.DataRow("本月票据4") = DataTables("pjmxb").sqlCompute("sum(开票金额)",filter1 & "And [到期日期] >= \'" & dt7 & "\'And [到期日期] <= \'" & dt8 & "\'and [兑付] = \'True\' ")/10000 e.DataRow("本月票据5") = DataTables("pjmxb").sqlCompute("Count(_Identify)",filter1 & "And [出票日期] >= \'" & dt7 & "\'And [出票日期] <= \'" & dt8 & "\'") e.DataRow("本月票据6") = DataTables("pjmxb").sqlCompute("sum(开票金额)",filter1 & "And [出票日期] >= \'" & dt7 & "\'And [出票日期] <= \'" & 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("本季票据2") = DataTables("pjmxb").sqlCompute("sum(开票金额)",filter1 & "And [到期日期] > \'" & dt11 & "\'And [到期日期] <= \'" & dt12 & "\'")/10000 e.DataRow("本季票据2") = DataTables("pjmxb").sqlCompute("sum(开票金额)",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("本年票据2") = DataTables("pjmxb").sqlCompute("sum(开票金额)",filter1 & "And [到期日期] > \'" & dt13 & "\'And [到期日期] <= \'" & dt14 & "\'")/10000 e.DataRow("本年票据4") = DataTables("pjmxb").sqlCompute("sum(开票金额)",filter1 & "And [到期日期] > \'" & dt13 & "\'And [到期日期] <= \'" & dt14 & "\'and [兑付] = \'True\' ")/10000 End If
|
-- 作者:有点蓝 -- 发布时间:2020/4/20 12:03:00 -- 提示什么错误?如果没有错误肯定就是没有符合条件的数据,或者数据没有保存。 Compute都改为sqlCompute
|