我想批量修改记录集!可是总出错
出错内容“当前记录几不支持更新,可能是程序限制,也可能是选定锁定类型的限制”
请予指点错勿,或给其他代码,详细一些!!不胜感激
Public Function ConnectToServer() As Boolean
Con.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=fushuen; "
Con.Open
ConnectToServer = True
Exit Function
End Function
Public Function ExecuteSQL(ByVal strsql As String) As Boolean
Con.Execute (strsql)
ExecuteSQL = True
End Function
Public Function QueryInfo(strsql As String)
Call Rs.Open(strsql, Con, adOpenDynamic, adLockOptimistic, -1)
End Function
执行的部分语句。我想把一批"状态=1"记录集做更改为"状态=0"
strsql = "select * from 明细表 where 状态=1"
Call QueryInfo(strsql)
If rs.RecordCount > 0 Then
rs.MoveFirst
Do While Not objrs.EOF
rs.Fields("状态").Value = 0
rs.MoveNext
rs.Update
rs.Close
End If