Adodc1.Recordset.MoveNext
删除后,当前条就不存在了,所以下一条,不知道是指的那一条的下一条。
如果是更新一个表,使用datatable就好了。Public Function UpDataTable(ByVal Tdb As DataTable) As Boolean
ReadOnly Conn_str As String = "你的数据库连接字符串"
Dim myda As SqlDataAdapter
Try
Dim pc As New SqlCommandBuilder(myda)
myda.UpdateCommand = pc.GetUpdateCommand
myda.Update(Tdb)
Return True
Catch ex As Exception
MsgBox(ex.ToString)
Return False
End Try
End Function
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)