Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 26th, 2004, 08:47 AM
Authorized User
 
Join Date: Aug 2004
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to humour
Default Locktype and code for batch updating


The code below works just fine....(simplified for clarity)

BUT...

I am not an expert on LockTypes or the Update options I have when parsing through a record set. Is the code below the most efficient? Specifically am I using the right lock mechanism. There will only be one user updating records when this code is run. Data contention is not an issue here.



rst.ActiveConnection = CurrentProject.Connection
SqlStr = "Select po_po_no, po_rec_no, po_reqd_date from purchasedetailstable "

rst.LockType = adLockBatchOptimistic
rst.CursorLocation = adUseClient
rst.CursorType = adOpenStatic
rst.Open (SqlStr)

Do Until rst.EOF
 rst.Fields.Item("desc").Value = "zzz"
 rst.MoveNext
 rst.UpdateBatch
Loop







Similar Threads
Thread Thread Starter Forum Replies Last Post
LockType Property of the RecordSet Class dslagle2 Excel VBA 1 August 22nd, 2007 01:37 PM
Help with LockType property dslagle2 BOOK: Excel 2003 VBA Programmer's Reference 0 August 22nd, 2007 12:33 PM
VB.Net Code for updating a record damanka2001 Access VBA 0 July 26th, 2007 04:59 PM
Updating Recordsets with LockType and Cursor Type arimakidd Classic ASP Databases 7 August 1st, 2005 09:23 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.