General information
Category:
Database DAO/RDO/ODBC/ADO
Title:
Microsoft Cursor Engine
I ave encountered an error when trying to update a recordset via ADO. It's source is the Microsoft Cursor Engine and says something to the effect that too many records existed to update. I am using the following syntax during the recordset update:
Public Function PutRS(rs As ADODB.Recordset) As Boolean
On Error GoTo LocalError
PutRS = False
If EmptyRS(rs) Then
Exit Function
ElseIf rs.LockType = adLockReadOnly Then
Exit Function
Else
Dim cn As New ADODB.Connection
With cn
.ConnectionString = ConnectionString
.CursorLocation = adUseServer
.Open
.BeginTrans
End With
With rs
.ActiveConnection = cn
.UpdateBatch
cn.CommitTrans
Set .ActiveConnection = Nothing
End With
cn.Close
Set cn = Nothing
End If
PutRS = True
Exit Function
LocalError:
Call ReportError(CStr(Now), CStr(Err.Number), CStr(Err.Description), CStr(Err.Source), "PutRS", True)
If cn.State = adStateOpen Then
cn.RollbackTrans
cn.Close
End If
Set cn = Nothing
PutRS = False
End Function
Does anyone have an idea? I am opening it with the following syntax:
With rs
.ActiveConnection = ConnectionString
.CursorLocation = adUseClient
.LockType = adLockOptimistic
.CursorType = adOpenKeyset
.Source = SQL
.Open
Set .ActiveConnection = Nothing
End With
Should I change anything about the way I open? The error only occurs when the recordset is sort of large. Does not occur on medium sized and smaller recordsets.
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only