F
fniles
In VB6 to add a new record in a recorset, you can use the Addnew method,
then set each column's value, then call the Update method.
How can I do this in VB.NET ?
Thank you.
VB6:
Private m_rs As new ADODB.Recordset
m_rs.Open "SELECT * FROM myTable", adoCon, adOpenKeyset, adLockOptimistic
with m_rs
.AddNew
.Fields("ip") = AccountIP & " " ' x.Address
.Fields("account") = Account & " " 'Left$(x.Key, 5)
.Fields("DATEtime") = Now & " "
.Fields("name") = userver & " "
.Update
end with
then set each column's value, then call the Update method.
How can I do this in VB.NET ?
Thank you.
VB6:
Private m_rs As new ADODB.Recordset
m_rs.Open "SELECT * FROM myTable", adoCon, adOpenKeyset, adLockOptimistic
with m_rs
.AddNew
.Fields("ip") = AccountIP & " " ' x.Address
.Fields("account") = Account & " " 'Left$(x.Key, 5)
.Fields("DATEtime") = Now & " "
.Fields("name") = userver & " "
.Update
end with