不知道你的ado什么版本,我用的是win2k的ado 2.5,没有你的感觉。

解决方案 »

  1.   

    我的ADO也是2.5的,普通的数据库操作是正常的,这可能跟计时器有关?
    但是我又不知道怎么解决,在每次被TIME执行时我也有打开和关闭数
    据库但效果也是一样,没有作用!
      

  2.   

    maybe Access has error. or your program has 'bug' code. pls use directly SQL, do not bind the recordset to any controls.
      

  3.   

    其实可以排除以上的可能因为有一位网友的状况和我一样,搞得让他让客户
    在一段时间内自动退出再进入!都有一个共同点就是用了TIMER控件它会产生
    一个线程吗?
      

  4.   

    procedure Tbuy.Timer1Timer(Sender: TObject);
    var
    gzsz:array[1..60] of boolean;
    jsrs,xsrs,hyrs,ykrs,txrs:integer;
    i:integer;
    begin
    timer1.Enabled:=false;
    jsrs:=0;
    xsrs:=0;
    hyrs:=0;
    ykrs:=0;
    txrs:=0;
    i:=1;
    with data.gzwl do
    begin
    close;
    open;
    first;
     while not Eof do
     begin
     if fieldbyname('fs').value='apple' then
     jsrs:=jsrs+1
     else if fieldbyname('fs').Value='orange' then
     hyrs:=hyrs+1
     else if fieldbyname('fs').Value='banger' then
     txrs:=txrs+1
     else if fieldbyname('fs').Value='sandwich' then
     xsrs:=xsrs+1
     else if fieldbyname('fs').Value='egg' then
     ykrs:=ykrs+1;
     gzsz[i]:=fieldbyname('netopen').Value;
     next;
     i:=i+1;
     end;
    close;
    end;
    if gzsz[1]=true then gz1.Color:=clLime
    else gz1.Color:=clred;
    if gzsz[2]=true then gz2.Color:=cllime
    else gz2.Color:=clred;
    if gzsz[3]=true then gz3.Color:=cllime
    else gz3.Color:=clred;
    if gzsz[4]=true then gz4.Color:=cllime
    else gz4.Color:=clred;
    if gzsz[5]=true then gz5.Color:=cllime
    else gz5.Color:=clred;
    if gzsz[6]=true then gz6.Color:=cllime
    else gz6.Color:=clred;
    if gzsz[7]=true then gz7.Color:=cllime
    else gz7.Color:=clred;
    if gzsz[8]=true then gz8.Color:=cllime
    else gz8.Color:=clred;
    if gzsz[9]=true then gz9.Color:=cllime
    else gz9.Color:=clred;
    if gzsz[10]=true then gz10.Color:=cllime
    else gz10.Color:=clred;
    if gzsz[11]=true then gz11.Color:=cllime
    else gz11.Color:=clred;
    if gzsz[12]=true then gz12.Color:=cllime
    else gz12.Color:=clred;
    if gzsz[13]=true then gz13.Color:=cllime
    else gz13.Color:=clred;
    if gzsz[14]=true then gz14.Color:=cllime
    else gz14.Color:=clred;
    if gzsz[15]=true then gz15.Color:=cllime
    else gz15.Color:=clred;
    if gzsz[16]=true then gz16.Color:=cllime
    else gz16.Color:=clred;
    if gzsz[17]=true then gz17.Color:=cllime
    else gz17.Color:=clred;
    if gzsz[18]=true then gz18.Color:=cllime
    else gz18.Color:=clred;
    if gzsz[19]=true then gz19.Color:=clLime
    else gz19.Color:=clred;
    if gzsz[20]=true then gz20.Color:=cllime
    else gz20.Color:=clred;
    if gzsz[21]=true then gz21.Color:=cllime
    else gz21.Color:=clred;
    if gzsz[22]=true then gz22.Color:=cllime
    else gz22.Color:=clred;
    if gzsz[23]=true then gz23.Color:=cllime
    else gz23.Color:=clred;
    if gzsz[24]=true then gz24.Color:=cllime
    else gz24.Color:=clred;
    if gzsz[25]=true then gz25.Color:=cllime
    else gz25.Color:=clred;
    if gzsz[26]=true then gz26.Color:=cllime
    else gz26.Color:=clred;
    if gzsz[27]=true then gz27.Color:=cllime
    else gz27.Color:=clred;
    if gzsz[28]=true then gz28.Color:=cllime
    else gz28.Color:=clred;
    if gzsz[29]=true then gz29.Color:=cllime
    else gz29.Color:=clred;
    if gzsz[30]=true then gz30.Color:=cllime
    else gz30.Color:=clred;
    if gzsz[31]=true then gz31.Color:=cllime
    else gz31.Color:=clred;
    if gzsz[32]=true then gz32.Color:=cllime
    else gz32.Color:=clred;
    if gzsz[33]=true then gz33.Color:=cllime
    else gz33.Color:=clred;
    if gzsz[34]=true then gz34.Color:=cllime
    else gz34.Color:=clred;
    if gzsz[35]=true then gz35.Color:=cllime
    else gz35.Color:=clred;
    if gzsz[36]=true then gz36.Color:=cllime
    else gz36.Color:=clred;
    if gzsz[37]=true then gz37.Color:=cllime
    else gz37.Color:=clred;
    if gzsz[38]=true then gz38.Color:=cllime
    else gz38.Color:=clred;
    if gzsz[39]=true then gz39.Color:=cllime
    else gz39.Color:=clred;
    if gzsz[40]=true then gz40.Color:=cllime
    else gz40.Color:=clred;
    if gzsz[41]=true then gz41.Color:=cllime
    else gz41.Color:=clred;
    if gzsz[42]=true then gz42.Color:=cllime
    else gz42.Color:=clred;
    if gzsz[43]=true then gz43.Color:=cllime
    else gz43.Color:=clred;
    if gzsz[44]=true then gz44.Color:=cllime
    else gz44.Color:=clred;
    if gzsz[45]=true then gz45.Color:=cllime
    else gz45.Color:=clred;
    if gzsz[46]=true then gz46.Color:=cllime
    else gz46.Color:=clred;
    if gzsz[47]=true then gz47.Color:=cllime
    else gz47.Color:=clred;
    if gzsz[48]=true then gz48.Color:=cllime
    else gz48.Color:=clred;
    if gzsz[49]=true then gz49.Color:=clLime
    else gz49.Color:=clred;
    if gzsz[50]=true then gz50.Color:=cllime
    else gz50.Color:=clred;
    if gzsz[51]=true then gz51.Color:=cllime
    else gz51.Color:=clred;
    if gzsz[52]=true then gz52.Color:=cllime
    else gz52.Color:=clred;
    if gzsz[53]=true then gz53.Color:=cllime
    else gz53.Color:=clred;
    if gzsz[54]=true then gz54.Color:=cllime
    else gz54.Color:=clred;
    if gzsz[55]=true then gz55.Color:=cllime
    else gz55.Color:=clred;
    if gzsz[56]=true then gz56.Color:=cllime
    else gz56.Color:=clred;
    if gzsz[57]=true then gz57.Color:=cllime
    else gz57.Color:=clred;
    if gzsz[58]=true then gz58.Color:=cllime
    else gz58.Color:=clred;
    if gzsz[59]=true then gz59.Color:=cllime
    else gz59.Color:=clred;
    if gzsz[60]=true then gz60.Color:=cllime
    else gz60.Color:=clred;
    jslab.Caption:=inttostr(jsrs);
    hylab.Caption:=inttostr(hyrs);
    txlab.Caption:=inttostr(txrs);
    xslab.Caption:=inttostr(xsrs);
    yklab.Caption:=inttostr(ykrs);
    tjlab.Caption:=inttostr(jsrs+hyrs+txrs+xsrs+ykrs);
    timer1.Enabled:=true;   
    end;
      

  5.   

    Timer1仅仅是为你方便处理WM_TIME消息,不干多线程什么事.
    使用它, 仍然是在主线程中执行.
    Michael_Song(Michael Song) 的建议建议听一下.
      

  6.   

    请教什么是 directly SQL?难道不是ADODATASET吗?
      

  7.   

    不是程序的问题,我觉得应该是access的问题.
    access在运行过程中会变得越来越大(尽管有时你对它进行的是删除操作),因为它要保存很多信息到数据库中(日志之类),所以access体积迅速庞大,自然会影响程序速度
      

  8.   

    觉得你的说法很有道理但又不能确定因为我的数据库只有80条记录只是不停地在原有的数据库 edit post 有影响吗还有退出进入后它又恢复了?
      

  9.   

    以下转自大富翁的相关资料!
    来自:vecm, 时间:2002-8-16 23:15:00, ID:1269999 
    同志,我可算找到你了!
    半年前我也遇到同样的问题,但比你更新数据库的速度还频繁。速度要求:“慢速1记录/s,快速7~8记录/s”。用单独线程做记录,5分钟后速度明显放缓!单步跟踪发现Post语句变得运行极慢!最后我的解决方法是“定义结构化文件”,自己写添加、删除、查询语句。速度方面绝对没问题,记录几十个小时都不会变慢。用文件吧,除了移植性差,编程量大些,性能没的说。 
     
    来自:Block_K_E, 时间:2002-8-16 23:33:00, ID:1270023 
    将CLose,open取消调试试。
     
     来自:delphiplayer, 时间:2002-8-17 0:39:00, ID:1270101 | 编辑 
    vecm您好非常感谢您提供的资料,但定义结构文件!天啊!我不是要累死!有没有其它办法,还有我听有人说这是因为ACCESS要记录日志文件造成的?我们是不是能找到更容易点办法,比如不要用ACCESS用ODBC的其它表可以吗请指教!
     
     
      

  10.   

    估计你的DataSet的属性设置有些问题,
    你看看下面几个参数这样设置后,是否解决问题:
    CacheSize=100
    CursorLocation=clUseClient
    Prepared=True
    还有,我看你上面的代码,不是编辑和修改啊,只是循环读取数据。
    如果是这样的话,继续设置以下参数:
    Cursortype=ctOpenForwardOnly
    LockType=ltReadOnly
    我想,这样,你解决你的问题。
      

  11.   

    你可以将ado的属性中,数据的属性改为 读写性质,这样速度会块很多
      

  12.   

    已经改过了,但问题依然存在。以上的增加缓冲区和精确度的方法可以一开始另速度有所提高。但是过一段时间也一样越来越慢!也许‘诸神的黄昏’说对了可能真的是ACCESS出问题了。问题没有解决,如果这个问题不能解决我将退回到用BDE的数据库。
      

  13.   

    我查看了在运行中的ACCESS表和TEMP临时文件区发现只多了一个文件但它的体积并没有增大(看来好像不是ACCESS的问题)。只要程序的主进程没有退出程序将越来越慢即使是动态创建释放也解决不了,我栽了!!!高手救命!!!!!!!!!!!
      

  14.   

    gzwl这个是不是一个ADOQUery呀?你里面的SQL语句是不是select * from....什么的,不要这样写你过多的select *当你的数据量小的时候不会出现问题,当数据量一大,时间一长就会让程序变是慢,当退出程序后再运行就会恢复状态!不知道我说的对不对?
      

  15.   

    可能和游标有关,用ctOpenForwardOnly效率比较高
    to cdws222(www.teatool.com) ,已经控制了timer1.enable,应该不会重复进入