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


  共有2190人关注过本帖平板打印复制链接

主题:窗口加载数据慢

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


加好友 发短信
等级:幼狐 帖子:93 积分:1029 威望:0 精华:0 注册:2018/4/28 23:27:00
窗口加载数据慢  发帖心情 Post By:2019/12/21 9:21:00 [只看该作者]

在窗口设计了一个控件,控件代码如下,并且在窗口放置了有关联关系的主表和明细表,在以前运行速度还可以接受,但近期速度特别慢,
是不是与数据量有关,现在主表数据量有1000条,明细表有6000条

Dim Filter As String
With e.Form.Controls("客户名称")
    If .Value IsNot Nothing Then
        Filter = "客户名称 = '" & .Value & "'"
    End If
End With
With e.Form.Controls("订单编号")
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "订单编号 = '" & .Value & "'"
    End If
End With
If Filter > "" Then
    Tables("铝窗订单主表").Filter = Filter
    
End If

Dim drs As List(Of DataRow) = DataTables("铝窗订单主表").Select("订单编号 = '" & e.form.controls("订单编号").Text & "'")
If drs.count > 0 Then
    e.form.controls("TextBox1").Text = drs(0)("备注")
    e.form.controls("TextBox2").Text = drs(0)("产品名称")
    e.form.controls("TextBox3").Text = drs(0)("铝窗颜色")
    e.form.controls("TextBox4").Text = drs(0)("玻璃类型")
    e.form.controls("TextBox5").Text = drs(0)("纱窗类型")
    e.form.controls("TextBox6").Text = drs(0)("锁向")
    e.form.controls("TextBox7").Text = drs(0)("一体窗材料")
Else
    e.form.controls("TextBox1").Text = Nothing
    e.form.controls("TextBox2").Text = Nothing
    e.form.controls("TextBox3").Text = Nothing
    e.form.controls("TextBox4").Text = Nothing
    e.form.controls("TextBox5").Text = Nothing
    e.form.controls("TextBox6").Text = Nothing
    e.form.controls("TextBox7").Text = Nothing
End If

 回到顶部