從一個8萬條記錄的資料庫里讀取記錄,符號條件的加一標記,代碼如下:
do while not rs.eof
strwtdh=rs!exp_num_s
strljdh=rs!exp_num_e
strqur="select exp_num_s,exp_num_e,isvalid from table where exp_num_e=strwtdh and exp_num_s=strljdh
set rstmp=gdbcurrendb.openrecordset(strqur,dbopendynaset)
if rstmp.recordcount>0 then
rstmp.edit
rstmp.isvalid=00
rstmp.update
endif
rs.movenext
loop
next
實際運行狀況是速度超慢,求高人指點問題出在那兒?是不是SQL陳述句的問題?謝謝!
uj5u.com熱心網友回復:
給資料庫做索引,加快搜索速度uj5u.com熱心網友回復:
你在Do....Loop里面回圈8萬次openrecordset、Update? 不能最后處理完了再Update嗎?uj5u.com熱心網友回復:
第一沒看明白你在干嘛。中間的SQL中變數,直接在引號里,還叫變數嗎?
第二,同樓上。
第三,貌似一條update陳述句就可以解決。
uj5u.com熱心網友回復:
是啊,變數名包含在括號中了怎么行呢如:strwtdh
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/96719.html
