Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Batch updating in ADO
Message
 
 
À
Tous
Information générale
Forum:
Visual Basic
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Titre:
Batch updating in ADO
Divers
Thread ID:
00594186
Message ID:
00594186
Vues:
69
I have a routine in an n-tier app that when runs, creates about 150,000 new records to insert into a table. Currently, it's inserting the record one-by-one and it's slow. Can anyone give some specific code sample to batch update all the records?

I'm weak in ADO anyway but I though maybe I can create a new recordset in the Business-tier, use AddNew to add new records from properties in my collection object and call UpdateBatch and somehow, magically it would be done but...

Something like this with LGOS being a collection of LG object
Set rsLGO = New Recordset
With rsLGO
   .CursorLocation = adUseClient
   .LockType = adLockBatchOptimistic
   .CursorType = adOpenKeyset
End With

For Each LGO in LGOS
   LGO.EstimatedQty = GetEstimatedTotalCount(LGO)
   rsLGO.AddNew
   CopyListGridOrderObjToListGridOrderRs LGO, rsLGO
Next
rsLGO.UpdateBatch
It's "my" world. You're just living in it.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform