Hi, I'm relatively new to Databases and have been working on some projects. I have a doubt of what methods are more appropriate when updating or inserting data in a table. Here are the two methods that i use.
1. Open e snapshot recordset, calculate things and insert or update with sql the result in the table. Example:
2. Open a recordset and use the edit command to update it
I don't know which one is faster or more appropriate. any help is very appreciated.
Thanks in advance.
1. Open e snapshot recordset, calculate things and insert or update with sql the result in the table. Example:
Code:
Dim DataSet as DAO.Recordset
Set DataSet = CurrentDb.OpenRecordset("Table", dbOpenSnapshot)
CurrentDb.Execute "INSERT INTO Table VALUES (Example)"
2. Open a recordset and use the edit command to update it
Code:
Dim DataSet as DAO.Recordset
Set DataSet = CurrentDb.OpenRecordset("Table")
DataSet.Edit
DataSet("Field") = Example
DataSet.Update
I don't know which one is faster or more appropriate. any help is very appreciated.
Thanks in advance.