Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

When adding a new record should I use ADO rst.AddNew or a SQL INSERT statement?

Ado insert record sql
0
Posted

When adding a new record should I use ADO rst.AddNew or a SQL INSERT statement?

0

The INSERT statement will give you better performance because you don’t have to create and pass around a recordset object. However the Recordset object gives you protection from data conflicts by raising an error if the user tries to update a record that has been modified by another user. Also on an error the Recordset object will crash out on the offending line, so you can find the problem easier. And when dealing with a memo field, which may contain single quotes or double quotes the AddNew method is easier to construct. But in general if you can do without the data conflict protection and want the performance then use the ADO connection object to execute a SQL statement.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123