Foxtable(狐表)用户栏目专家坐堂 → 保存文件时,提示运行错误,如何解决?


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

主题:保存文件时,提示运行错误,如何解决?

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


加好友 发短信
等级:二尾狐 帖子:527 积分:5868 威望:0 精华:0 注册:2008/9/7 20:15:00
保存文件时,提示运行错误,如何解决?  发帖心情 Post By:2020/12/24 8:32:00 [只看该作者]


.NET Framework 版本:4.0.30319.42000
Foxtable 版本:2020.5.29.8
错误所在事件:
详细错误信息:
定义了过多字段。

下面是按钮代码:是不是因为这个按钮代码的原因?老师帮忙给看看(应该是28个)

e.Form.Controls("Label1").Text = "正在统计平均分及最低分排名,请稍后..."
Application.DoEvents()
Dim timestart,timeend As Date
timestart=Date.now


Dim dt1 As DataTable = DataTables("专业录取线")
Dim dt2 As DataTable = DataTables("一分一档")
For Each dr As DataRow In dt1.Select("")
    Dim filter As String = "选科系列 = '" & dr("物理系列") & "' and 录取年度 = '" & dr("录取年度") & "' and 最低分 = '" & dr("平均分") & "'"
    Dim fdr = dt2.find(filter)
    If fdr IsNot Nothing Then
        dr("物理组总_均分排名") = fdr("全省排名")
    End If

Next

For Each dr As DataRow In dt1.Select("")
    Dim filter As String = "选科系列 = '" & dr("物理系列") & "' and 录取年度 = '" & dr("录取年度") & "' and 最低分 = '" & dr("最低分") & "'"
    Dim fdr = dt2.find(filter)
    If fdr IsNot Nothing Then
        dr("物理组总_低分排名") = fdr("全省排名")
    End If

Next

For Each dr As DataRow In dt1.Select("")
    Dim filter As String = "选科系列 = '" & dr("物化生") & "' and 录取年度 = '" & dr("录取年度") & "' and 最低分 = '" & dr("平均分") & "'"
    Dim fdr = dt2.find(filter)
    If fdr IsNot Nothing Then
        dr("物化生_均分排名") = fdr("全省排名")
    End If

Next

For Each dr As DataRow In dt1.Select("")
    Dim filter As String = "选科系列 = '" & dr("物化生") & "' and 录取年度 = '" & dr("录取年度") & "' and 最低分 = '" & dr("最低分") & "'"
    Dim fdr = dt2.find(filter)
    If fdr IsNot Nothing Then
        dr("物化生_低分排名") = fdr("全省排名")
    End If

Next

For Each dr As DataRow In dt1.Select("")
    Dim filter As String = "选科系列 = '" & dr("物化地") & "' and 录取年度 = '" & dr("录取年度") & "' and 最低分 = '" & dr("平均分") & "'"
    Dim fdr = dt2.find(filter)
    If fdr IsNot Nothing Then
        dr("物化地_均分排名") = fdr("全省排名")
    End If

Next

For Each dr As DataRow In dt1.Select("")
    Dim filter As String = "选科系列 = '" & dr("物化地") & "' and 录取年度 = '" & dr("录取年度") & "' and 最低分 = '" & dr("最低分") & "'"
    Dim fdr = dt2.find(filter)
    If fdr IsNot Nothing Then
        dr("物化地_低分排名") = fdr("全省排名")
    End If

Next

For Each dr As DataRow In dt1.Select("")
    Dim filter As String = "选科系列 = '" & dr("物化政") & "' and 录取年度 = '" & dr("录取年度") & "' and 最低分 = '" & dr("平均分") & "'"
    Dim fdr = dt2.find(filter)
    If fdr IsNot Nothing Then
        dr("物化政_均分排名") = fdr("全省排名")
    End If

Next

For Each dr As DataRow In dt1.Select("")
    Dim filter As String = "选科系列 = '" & dr("物化政") & "' and 录取年度 = '" & dr("录取年度") & "' and 最低分 = '" & dr("最低分") & "'"
    Dim fdr = dt2.find(filter)
    If fdr IsNot Nothing Then
        dr("物化政_低分排名") = fdr("全省排名")
    End If

Next

For Each dr As DataRow In dt1.Select("")
    Dim filter As String = "选科系列 = '" & dr("物生地") & "' and 录取年度 = '" & dr("录取年度") & "' and 最低分 = '" & dr("平均分") & "'"
    Dim fdr = dt2.find(filter)
    If fdr IsNot Nothing Then
        dr("物生地_均分排名") = fdr("全省排名")
    End If

Next

For Each dr As DataRow In dt1.Select("")
    Dim filter As String = "选科系列 = '" & dr("物生地") & "' and 录取年度 = '" & dr("录取年度") & "' and 最低分 = '" & dr("最低分") & "'"
    Dim fdr = dt2.find(filter)
    If fdr IsNot Nothing Then
        dr("物生地_低分排名") = fdr("全省排名")
    End If

Next

For Each dr As DataRow In dt1.Select("")
    Dim filter As String = "选科系列 = '" & dr("物生政") & "' and 录取年度 = '" & dr("录取年度") & "' and 最低分 = '" & dr("平均分") & "'"
    Dim fdr = dt2.find(filter)
    If fdr IsNot Nothing Then
        dr("物生政_均分排名") = fdr("全省排名")
    End If

Next

For Each dr As DataRow In dt1.Select("")
    Dim filter As String = "选科系列 = '" & dr("物生政") & "' and 录取年度 = '" & dr("录取年度") & "' and 最低分 = '" & dr("最低分") & "'"
    Dim fdr = dt2.find(filter)
    If fdr IsNot Nothing Then
        dr("物生政_低分排名") = fdr("全省排名")
    End If

Next

For Each dr As DataRow In dt1.Select("")
    Dim filter As String = "选科系列 = '" & dr("物地政") & "' and 录取年度 = '" & dr("录取年度") & "' and 最低分 = '" & dr("平均分") & "'"
    Dim fdr = dt2.find(filter)
    If fdr IsNot Nothing Then
        dr("物地政_均分排名") = fdr("全省排名")
    End If

Next

For Each dr As DataRow In dt1.Select("")
    Dim filter As String = "选科系列 = '" & dr("物地政") & "' and 录取年度 = '" & dr("录取年度") & "' and 最低分 = '" & dr("最低分") & "'"
    Dim fdr = dt2.find(filter)
    If fdr IsNot Nothing Then
        dr("物地政_低分排名") = fdr("全省排名")
    End If

Next


For Each dr As DataRow In dt1.Select("")
    Dim filter As String = "选科系列 = '" & dr("历史系列") & "' and 录取年度 = '" & dr("录取年度") & "' and 最低分 = '" & dr("平均分") & "'"
    Dim fdr = dt2.find(filter)
    If fdr IsNot Nothing Then
        dr("历史组总_均分排名") = fdr("全省排名")
    End If

Next

For Each dr As DataRow In dt1.Select("")
    Dim filter As String = "选科系列 = '" & dr("历史系列") & "' and 录取年度 = '" & dr("录取年度") & "' and 最低分 = '" & dr("最低分") & "'"
    Dim fdr = dt2.find(filter)
    If fdr IsNot Nothing Then
        dr("历史组总_低分排名") = fdr("全省排名")
    End If

Next

For Each dr As DataRow In dt1.Select("")
    Dim filter As String = "选科系列 = '" & dr("史化生") & "' and 录取年度 = '" & dr("录取年度") & "' and 最低分 = '" & dr("平均分") & "'"
    Dim fdr = dt2.find(filter)
    If fdr IsNot Nothing Then
        dr("史化生_均分排名") = fdr("全省排名")
    End If

Next

For Each dr As DataRow In dt1.Select("")
    Dim filter As String = "选科系列 = '" & dr("史化生") & "' and 录取年度 = '" & dr("录取年度") & "' and 最低分 = '" & dr("最低分") & "'"
    Dim fdr = dt2.find(filter)
    If fdr IsNot Nothing Then
        dr("史化生_低分排名") = fdr("全省排名")
    End If

Next

For Each dr As DataRow In dt1.Select("")
    Dim filter As String = "选科系列 = '" & dr("史化地") & "' and 录取年度 = '" & dr("录取年度") & "' and 最低分 = '" & dr("平均分") & "'"
    Dim fdr = dt2.find(filter)
    If fdr IsNot Nothing Then
        dr("史化地_均分排名") = fdr("全省排名")
    End If

Next

For Each dr As DataRow In dt1.Select("")
    Dim filter As String = "选科系列 = '" & dr("史化地") & "' and 录取年度 = '" & dr("录取年度") & "' and 最低分 = '" & dr("最低分") & "'"
    Dim fdr = dt2.find(filter)
    If fdr IsNot Nothing Then
        dr("史化地_低分排名") = fdr("全省排名")
    End If

Next

For Each dr As DataRow In dt1.Select("")
    Dim filter As String = "选科系列 = '" & dr("史化政") & "' and 录取年度 = '" & dr("录取年度") & "' and 最低分 = '" & dr("平均分") & "'"
    Dim fdr = dt2.find(filter)
    If fdr IsNot Nothing Then
        dr("史化政_均分排名") = fdr("全省排名")
    End If

Next

For Each dr As DataRow In dt1.Select("")
    Dim filter As String = "选科系列 = '" & dr("史化政") & "' and 录取年度 = '" & dr("录取年度") & "' and 最低分 = '" & dr("最低分") & "'"
    Dim fdr = dt2.find(filter)
    If fdr IsNot Nothing Then
        dr("史化政_低分排名") = fdr("全省排名")
    End If

Next

For Each dr As DataRow In dt1.Select("")
    Dim filter As String = "选科系列 = '" & dr("史生地") & "' and 录取年度 = '" & dr("录取年度") & "' and 最低分 = '" & dr("平均分") & "'"
    Dim fdr = dt2.find(filter)
    If fdr IsNot Nothing Then
        dr("史生地_均分排名") = fdr("全省排名")
    End If

Next

For Each dr As DataRow In dt1.Select("")
    Dim filter As String = "选科系列 = '" & dr("史生地") & "' and 录取年度 = '" & dr("录取年度") & "' and 最低分 = '" & dr("最低分") & "'"
    Dim fdr = dt2.find(filter)
    If fdr IsNot Nothing Then
        dr("史生地_低分排名") = fdr("全省排名")
    End If

Next

For Each dr As DataRow In dt1.Select("")
    Dim filter As String = "选科系列 = '" & dr("史生政") & "' and 录取年度 = '" & dr("录取年度") & "' and 最低分 = '" & dr("平均分") & "'"
    Dim fdr = dt2.find(filter)
    If fdr IsNot Nothing Then
        dr("史生政_均分排名") = fdr("全省排名")
    End If

Next

For Each dr As DataRow In dt1.Select("")
    Dim filter As String = "选科系列 = '" & dr("史生政") & "' and 录取年度 = '" & dr("录取年度") & "' and 最低分 = '" & dr("最低分") & "'"
    Dim fdr = dt2.find(filter)
    If fdr IsNot Nothing Then
        dr("史生政_低分排名") = fdr("全省排名")
    End If

Next

For Each dr As DataRow In dt1.Select("")
    Dim filter As String = "选科系列 = '" & dr("史地政") & "' and 录取年度 = '" & dr("录取年度") & "' and 最低分 = '" & dr("平均分") & "'"
    Dim fdr = dt2.find(filter)
    If fdr IsNot Nothing Then
        dr("史地政_均分排名") = fdr("全省排名")
    End If

Next

For Each dr As DataRow In dt1.Select("")
    Dim filter As String = "选科系列 = '" & dr("史地政") & "' and 录取年度 = '" & dr("录取年度") & "' and 最低分 = '" & dr("最低分") & "'"
    Dim fdr = dt2.find(filter)
    If fdr IsNot Nothing Then
        dr("史地政_低分排名") = fdr("全省排名")
    End If

Next


e.Form.Controls("Label1").Text = "平均分及最低分排名统计完成!"
timeend=Date.now
e.Form.Controls("Label1").text="耗时" & (timeend-timestart).TotalSeconds & "秒"
Messagebox.Show("项目完毕,请继续!")


窗口按钮可以运行,就是不能保存文件!保存文件的时候提示这个错误!!
[此贴子已经被作者于2020/12/24 8:33:04编辑过]

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


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

按钮代码可以运行,肯定就不是按钮代码的问题。检查保存的时候会触发什么事件

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


加好友 发短信
等级:二尾狐 帖子:527 积分:5868 威望:0 精华:0 注册:2008/9/7 20:15:00
  发帖心情 Post By:2020/12/24 9:54:00 [只看该作者]

提示:定义了过多字段,估计是哪里?已经查了好几遍了。没找到问题出在哪里

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


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

压缩一下项目,如果使用的是access数据库,使用access打开数据库压缩一下数据库

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


加好友 发短信
等级:二尾狐 帖子:527 积分:5868 威望:0 精华:0 注册:2008/9/7 20:15:00
  发帖心情 Post By:2020/12/24 10:22:00 [只看该作者]

使用access数据库,压缩项目,问题依旧!

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


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

请上传实例测试

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


加好友 发短信
等级:二尾狐 帖子:527 积分:5868 威望:0 精华:0 注册:2008/9/7 20:15:00
  发帖心情 Post By:2020/12/24 10:33:00 [只看该作者]

数据量太大,240M,传不来。刚才我是这样操作了一下。窗口按钮另存文件后。关闭项目,不保存!然后打开项目,再导入窗口按钮,直接读取先前保存的。然后再保存项目。结果错误提示没有了。不提示了,运行按钮公式,一切正常。有点奇怪!!不过问题解决了。谢谢老师。

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


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

项目文件不要用来存储太多数据,建议使用外部数据库

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


加好友 发短信
等级:二尾狐 帖子:527 积分:5868 威望:0 精华:0 注册:2008/9/7 20:15:00
  发帖心情 Post By:2020/12/24 11:07:00 [只看该作者]

嗯嗯,谢谢老师!在逐渐地学习!!

 回到顶部
帅哥哟,离线,有人找我吗?
程序猿
  10楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:115 积分:1064 威望:0 精华:0 注册:2019/10/31 15:02:00
  发帖心情 Post By:2020/12/24 12:27:00 [只看该作者]

你这样写代码,维护和查错不心累吗图片点击可在新窗口打开查看

 回到顶部
总数 12 1 2 下一页