What's the problem in the following code ?
How can I write an alternate?

VB Code:
  1. sql = "SELECT A.EMP_DEPT_CODE FROM EMP_MASTER A, EMP_DEPT B WHERE A.EMP_ID = B.EMP_ID AND B.EMP_DEPT_ID = 3"
  2. rst.open sql, DB_CONN, adOpenDynamic, adLockOptimistic
  3. Do Until rst.EOF
  4.   rst("EMP_DEPT_CODE") = "NEW_CODE"
  5.   rst.Update
  6.   rst.MoveNext
  7. Loop
  8. rst.Close

It's giving error

Run-time error '3251':
Current Recordset does not support updating. This may be a limitation of the Provider, or of the Selected locktype.