rs.Open "dag1", cn, adOpenKeyset, adLockPessimistic
这个里面..你的sql语句是错误的..错误不是
For i = 0 To rs.Fields.Count - 1
rs.Open "dag1", cn, adOpenKeyset, adLockPessimistic
改为
rs.Open "select * from dag1", cn, adOpenKeyset, adLockPessimistic
For i = 0 To rs.Fields.Count - 1;这句SQL语句表达错误