Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Batch updating in ADO
Message
From
13/12/2001 20:06:46
 
 
To
All
General information
Forum:
Visual Basic
Category:
Database DAO/RDO/ODBC/ADO
Title:
Batch updating in ADO
Miscellaneous
Thread ID:
00594186
Message ID:
00594186
Views:
68
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.
Next
Reply
Map
View

Click here to load this message in the networking platform