Reputation: 931
I am converting VB 6.0 code to VB.Net. In the VB 6.0 code I see the following use of a recordset
varFields = Array([set of column names])
varData = Array([matching data])
recordset.Open "[a query that will return 0 results]", connection, adOpenDynamic, adLockOptimistic
recordset.AddNew varFields, varData
recordset.Close
As I understand it, with adOpenDynamic, this will not update the database with out a call to Update.
Could someone explain to me if this set of code is doing anything?
Thank you
Upvotes: 2
Views: 439
Reputation: 78185
Yes, the code is valid.
As documented:
In immediate update mode ... If you pass the
Fieldlist
andValues
arguments, ADO immediately posts the new record to the database (noUpdate
call is necessary); theEditMode
property value does not change (adEditNone
).
Upvotes: 3