> It would be one lock per record involved, right?
With record locking, generally yes (read further down), as far as a "per record" issue, but a "record" in a recordset may not always mean one row in a single table in the database (Joins). So the update may lock two or more records in different tables, causing one lock per record involved as you stated, but maby two or more locks for the update because more than one row in different tables may be involed in the single recordset update.
And concerning a JET Mdb, it depends on the type of default locking - Page (default) or Record locking.
If Page locking is used, then one Page could consist of more than one row including partial rows, causing possibly less total locks than the number of rows being updated. Therefore, you could do a bulk deletion or update on 30,000 rows/records, but only need less than the default max locks allowed of 9,500.
On the reverse side, one record could span accross more than one page, causing more than one lock for a single update. Therefore, you could do a bulk deletion or update on 30,000 rows/records, but need more than 30,000 locks.
As far as how many rows and partial rows are involved in a single page, or how many pages or partial pages a row consists of, depends on the size of the data and metadata: How many columns/fields there are, their sizes and the data contained in them (such as Long Binary fields).
>4. Keep a counter of the updated records, and when you have a certain number, say a few records less than the maximum allowable locks, call updatebatch. You'd use SB's option 1, except within each loop, check the counter against the maxlocks value and call updatebatch when you're about to get too many
Yes you could do this (use the counter and if the max isn't reached, then call just .Update, and if reached, then call .UpdateBatch).
But in order to do this properly, you need to know the max lcoks setting, meaning first querying the registry value for MaxLocksPerFile, and you need to know approxmately how many rows are affected by each update, and if page locking is enabled, how many pages the row uses.
Please be aware though, that the locks Jet would need for an update, are Lock-requests. Jet doesn't actually place any locks on a file. It requests the OS to do so. This means that even though you can raise the max locks per file (mdb in this case) to a very high number, the amount of locks which can actually be placed depends on available resources, and the max allowed by the OS/Server. On Novell servers for instance, there is a max of 10,000 locks, slightly above the Jet default of 9,500. I think! in later versions of Jet, when the max locks needed are higher that the server allows, but the number set in Jet is, Jet will split the Updates into two or more transactions. This assures the update isn't halted because of a lock limitation, however, it sure does assure the batch update integrity as may be required (first back succeeds and second batch fails due to some other error)