标题:vf表通过筛选set filter 后,多人读写速度慢,一人读写很快,谁能告诉我这是 ...
取消只看楼主
wabc327
Rank: 1
等 级:新手上路
帖 子:44
专家分:0
注 册:2021-2-4
结帖率:28.57%
已结贴  问题点数:20 回复次数:6 
vf表通过筛选set filter 后,多人读写速度慢,一人读写很快,谁能告诉我这是什么原因啊!
vf表通过筛选set filter 后,多人读写速度慢,一人读写很快,谁能告诉我这是什么原因啊!
搜索更多相关主题的帖子: 原因 set filter 速度 读写 
2022-06-01 18:19
wabc327
Rank: 1
等 级:新手上路
帖 子:44
专家分:0
注 册:2021-2-4
得分:0 
Vfp表 已按录入员分组  每个录入员只能对自己录入的记录修改、删除  多人员可添加记录 按条件读取全部记录
2022-06-01 19:54
wabc327
Rank: 1
等 级:新手上路
帖 子:44
专家分:0
注 册:2021-2-4
得分:0 
回复 4楼 zhken
能否给个事例啊 怎样锁定更新啊 小弟学习一下

[此贴子已经被作者于2022-6-1 22:03编辑过]

2022-06-01 22:02
wabc327
Rank: 1
等 级:新手上路
帖 子:44
专家分:0
注 册:2021-2-4
得分:0 
回复 6楼 吹水佬

档案号文本框(有两个事件:第一个GotFocus)筛选后恢复所有以供再次筛选
sele b_dagl
set filter to
set order to dahpxmlh
go top               
档案号文本框(第二个lostFocus)主要是筛选后将顶记录其他C1文本控件赋值,这一步如果一人操作时还可以,人越多越慢
public wm_xm,wm_dah
wm_dah=this.value
*!*    mll="dah='"+wm_dah+"'"  
          mll="dah=wm_dah"         
    if len(alltrim(wm_dah))<7
        =messagebox('档案号不能为空,且必须7位以上长度!',0+16,'错误信息')
         
         
         
         ("enabled",.f.)
          retu
    endif
    set filter to &mll
    count to clfs  &&统计材料份数等同记录个数
    if clfs >0     
        sum ys to clys                                    
        go top               
        store dah to thisform.c1.txtdah.value
        store sfzh to thisform.c1.txtsfzh.value
        store xm to thisform.c1.txtxm.value
        wm_xm=xm                             
        store xb to thisform.c1.txtxb.value
        store csrq to thisform.c1.txtcsrq.value
        store jg to thisform.c1.Txtjg.value
        store mz to thisform.c1.Txtmz.value
        store zb to thisform.c1.Txtzb.value
        store zt to thisform.c1.Txtzt.value
        store dwmc to thisform.c1.Txtdwmc.value
        store zxbz to thisform.c1.Txtzxbz.value
        store "姓名:"+wm_xm+space(20)+"材料份数:"+allt(str(clfs))+space(20)+"材料页数:"+allt(str(clys)) to thisform.caption
        thisform.
    else
            messagebox('该档案信息未录入,不能补充材料',0+16,"错误信息")
            
            
            
            ("enabled",.f.)
              retu
    endif
    THISFORM.REFRESH


大类别文本框(有两个事件,click事件)
    thisform.C1.txtdnf.setfocus
大类别文本框(有两个事件,第二个lostFocus事件)这一步如果一人操作时还可以,人越多越慢
    public mll,mcx[2]
    mcx[1]=alltrim(thisform.c1.txtdah.value)
    sele b_lb
    mcx[2]=zclb
    mll=""
        if  alltrim(mcx[2])="1-" .or. alltrim(mcx[2])="2-" .or. alltrim(mcx[2])="3-" .or. alltrim(mcx[2])="5-" .or. alltrim(mcx[2])="6-" .or. alltrim(mcx[2])="7-" .or. alltrim(mcx[2])="8-"
            mll="mcx[2] = subs(yjmlh,1,2)"
        else
            if alltrim(mcx[2])="10-"
                mll="mcx[2] = subs(yjmlh,1,3)"
            else
                mll="mcx[2] = subs(yjmlh,1,4)"   
            endif
        endif
               mll="dah=mcx[1] .and. "+mll
        sele b_dagl
        set filter to
        set order to dahpxmlh
            set filter to &mll
            count to clfs
             sum ys to clys
            store "姓名:"+wm_xm+space(20)+"材料份数:"+allt(str(clfs))+space(20)+"材料页数:"+allt(str(clys)) to thisform.caption
             go top
        thisform.C1.txtdnf.setfocus        
        THISFORM.REFRESH


确定(click事件)这一步也是时而慢得很
SELE b_dagl
count to jls                        &&统计筛选类别后记录数
IF JLS>0            
    go bott                                &&指向记录尾
            jsq=len(rtrim(pxmlh))               &&删除了字符表达式后续空格后,返回结果字符串长度
            mlh_zdfs=val(subs(pxmlh,jsq-2,3))   &&取出最大份数
                    if jls = mlh_zdfs                         &&判断最大份数是否与该类别记录数相等
                            DO CASE
                                    CASE val(thisform.c1.txtdnf.value)<=JLS   
                                            blpxmlh1=subs(pxmlh,1,jsq-3)                                           &&取出需要补录的大类别,带空格排序目录号pxmlh
                                            blyjmlh = alltrim(subs(blpxmlh1,1,3))+alltrim(subs(blpxmlh1,4,7))      &&取出移交大类别,不带空格正常目录号zcmlh
                                            m_pxmlh=alltrim(THISFORM.C1.txtpxmlh.VALUE)            
                                            mlh_fs=val(subs(m_pxmlh,jsq-2,3))    &&mlh_fs=val(subs(pxmlh,jsq-2,3)  取表单第几份也可以或查找取出当前记录取出第几份  
                    
                        do while .not. bof() .and. alltrim(thisform.c1.txtdah.value) = dah .and. blpxmlh1=subs(pxmlh,1,jsq-3) .and. val(subs(pxmlh,jsq-2,3))>=mlh_fs   
                                                blpxmlh2=str(val(subs(pxmlh,jsq-2,3))+1,3)                          &&目录末位 第几份资料顺序加1
                        repl yjmlh with blyjmlh+alltrim(blpxmlh2),pxmlh with blpxmlh1+blpxmlh2,gjsy with alltrim(dah)+"-"+blyjmlh+alltrim(blpxmlh2)+'-'+alltrim(str(ys))
                                                skip -1
                                            enddo
                        insert into b_dagl (dah,xm,xb,mz,csrq,sfzh,zb,jg,dwmc,zt,pxmlh,yjmlh,clmc,clrq,ys,bz,gjsy,lry,lrrq);
values (alltrim(thisform.c1.txtdah.value),THISFORM.C1.txtxm.VALUE,THISFORM.C1.txtxb.VALUE,THISFORM.C1.Txtmz.VALUE,THISFORM.C1.txtcsrq.VALUE,;
THISFORM.C1.txtsfzh.VALUE,thisform.c1.Txtzb.value,thisform.c1.Txtjg.value,thisform.c1.Txtdwmc.value,thisform.c1.Txtzt.value,THISFORM.C1.txtpxmlh.VALUE,THISFORM.C1.txtyjmlh.VALUE,THISFORM.C1.txtclmc.value,;
THISFORM.C1.txtclrq.VALUE, val(THISFORM.C1.txtys.VALUE),THISFORM.C1.txtbz.VALUE,THISFORM.C1.txtgjsy.VALUE,THISFORM.C1.txtlry.VALUE,THISFORM.C1.txtlrrq.VALUE)         
                        CASE val(thisform.c1.txtdnf.value)=JLS+1
insert into b_dagl (dah,xm,xb,mz,csrq,sfzh,zb,jg,dwmc,zt,pxmlh,yjmlh,clmc,clrq,ys,bz,gjsy,lry,lrrq);
values (alltrim(thisform.c1.txtdah.value),THISFORM.C1.txtxm.VALUE,THISFORM.C1.txtxb.VALUE,THISFORM.C1.Txtmz.VALUE,THISFORM.C1.txtcsrq.VALUE,;
THISFORM.C1.txtsfzh.VALUE,thisform.c1.Txtzb.value,thisform.c1.Txtjg.value,thisform.c1.Txtdwmc.value,thisform.c1.Txtzt.value,THISFORM.C1.txtpxmlh.VALUE,THISFORM.C1.txtyjmlh.VALUE,THISFORM.C1.txtclmc.value,;
THISFORM.C1.txtclrq.VALUE, val(THISFORM.C1.txtys.VALUE),THISFORM.C1.txtbz.VALUE,THISFORM.C1.txtgjsy.VALUE,THISFORM.C1.txtlry.VALUE,THISFORM.C1.txtlrrq.VALUE)              
                                    OTHERWISE
                                             =messagebox('该档案目录无需补充,请确认“整理”后到档案目录管理中[添加]!',0+64,'提示信息')
                                             
                                             
                                             
                                             ("enabled",.f.)
                                             retu  
                            ENDCASE                    
                    
                    else
                            =messagebox('该档案目录未录入完整,不能补充目录,请到档案目录管理中[添加]补充完整!',0+64,'提示信息')
                             
                           
                           
                            ("enabled",.f.)
                            retu               
                    endif            
ELSE

                    if  JLS=0 AND val(thisform.c1.txtdnf.value)=1     && OR JLS = mlh_zdfs AND JLS+1=val(thisform.c1.txtdnf.value)   &&jls=0 and val(thisform.c1.txtdnf.value)=1 or
                        insert into   b_dagl (dah,xm,xb,mz,csrq,sfzh,zb,jg,dwmc,zt,pxmlh,yjmlh,clmc,clrq,ys,bz,gjsy,lry,lrrq);
                        values (alltrim(thisform.c1.txtdah.value),THISFORM.C1.txtxm.VALUE,THISFORM.C1.txtxb.VALUE,THISFORM.C1.Txtmz.VALUE,THISFORM.C1.txtcsrq.VALUE,;
THISFORM.C1.txtsfzh.VALUE,thisform.c1.Txtzb.value,thisform.c1.Txtjg.value,thisform.c1.Txtdwmc.value,thisform.c1.Txtzt.value,THISFORM.C1.txtpxmlh.VALUE,THISFORM.C1.txtyjmlh.VALUE,THISFORM.C1.txtclmc.value,;
THISFORM.C1.txtclrq.VALUE, val(THISFORM.C1.txtys.VALUE),THISFORM.C1.txtbz.VALUE,THISFORM.C1.txtgjsy.VALUE,THISFORM.C1.txtlry.VALUE,THISFORM.C1.txtlrrq.VALUE)
                    else
                         =messagebox('该档案目录无需补充,请确认“整理”后到档案目录管理中[添加]!',0+64,'提示信息')
                        
                        
                        
                         ("enabled",.f.)
                         retu
                    endif
ENDIF
                count to clfs
                 sum ys to clys
                store "姓名:"+wm_xm+"      "+"材料份数:"+allt(str(clfs))+"              "+"材料页数:"+allt(str(clys)) to thisform.caption
                go top        
                    THISFORM.GRID1.Refresh
                =messagebox("档案信息补充成功",0+64,"系统提示")
               

请您指教,万分感谢!


[此贴子已经被作者于2022-6-2 09:25编辑过]

2022-06-02 09:24
wabc327
Rank: 1
等 级:新手上路
帖 子:44
专家分:0
注 册:2021-2-4
得分:0 
回复 7楼 hu9jj
我已把程序传上来了 怎样用SQL语句优化 请指教
2022-06-02 09:48
wabc327
Rank: 1
等 级:新手上路
帖 子:44
专家分:0
注 册:2021-2-4
得分:0 
回复 6楼 吹水佬
大师 请帮忙看看呗 非常感谢!!!
jh.rar (17.51 KB)
2022-06-02 10:41
wabc327
Rank: 1
等 级:新手上路
帖 子:44
专家分:0
注 册:2021-2-4
得分:0 
多用户下grid我使用的是行缓冲,如果改用表缓冲是否会有所改善呢,另外insert into在有grid同时显示的情况下,用缓冲么,是先用insert into再用=tableupdate()么,还是不用缓冲直接插入就可以,或者是先插入后随后跟一个=tableupdate()呢,有点迷糊啊?????请各位老师帮忙解答一下!!!
2022-06-07 09:40



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-509237-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.247153 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved