Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Manual Commit

Status
Not open for further replies.

sam93

Programmer
Jul 19, 2002
65
CA
Hi,

I want to change the default behavior of auto committing any changes made in a record as soon as I leave it and want to commit changes made in multiple records on the click of a button.

1. How do I disable default committing?
2. How can I save changes in multiple records explicitly?

Thanks.
 
first of all stop using bound controls.

And you can update multiple records by isssuing a "update xxx set yyy = zzz, ddd = aaa where lkh = asd"


Regards

Frederico Fonseca
SysSoft Integrated Ltd
 
If you're using ADO to update a database table, you might consider the technique of opening a Recordset in batch update mode, updating it as desired, and then reconnecting it and doing an UpdateBatch against it.

There is a description of this where the Recordset even gets persisted to a disk file, transported to a second machine, updated remotely, transported back, and then finally reconnected and posted to the database at:

Disconnected Recordsets

Of course you'd just skip all of that intermediate stuff.


Depending on your situation you might choose to use transactional updating of the Recordset, and only at the end of your updates decide whether to commit or roll back the changes.

Here's one brief discussion:

INFO: Understanding ADO Transactions with MS SQL Server


All of this depends on your situation, of course. Sometimes ADO updates aren't a good answer. It depends on what you're trying to accomplish. Explicit SQL updating has it's downsides too.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top