/******* part of the code *******/
/*******idarr () and Codearr () are two arrays, where Idarr () is the filter data filtering condition, Codearr () as the update data **********/
.......
Dim crs,sql,fstr
Sql= ""
Conn.begintrans
Set Crs=server. CreateObject ("Adodb.recordset")
Crs.activeconnection=conn
Crs.cursortype=1
Crs.locktype=3
Crs.source= "SELECT * from Mb_dcmanage"
Crs.open
For i=0 to UBound (Codearr)-1
Fstr= "dcm_id=" &idarr (i) ' defines data filtering
Crs.filter=fstr
CRs ("Dcm_code") =codearr (i)
Next
Crs.updatebatch (3) ' Batch update
........
/*********** avoids duplication of open operations, but filter itself is efficient, it should be combined with transaction processing, filter can be selected by multiple conditions, UpdateBatch parameters-----adaffectcurrent (1): Current position;
adAffectGroup (2): data that conforms to the filter
Adaffterall (3): All current Data ***************/