Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Microsoft Cursor Engine
Message
 
À
Tous
Information générale
Forum:
Visual Basic
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Titre:
Microsoft Cursor Engine
Divers
Thread ID:
00647401
Message ID:
00647401
Vues:
44
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.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform