问题描述
在VB6中,在recorset中添加新记录,可以使用Addnew方法,然后设置每个列的值,然后调用Update方法。
如何在VB.NET中执行此操作?
谢谢。
VB6:
私有m_rs作为新的ADODB .Recordset
m_rs.Open" SELECT * FROM myTable",adoCon,adOpenKeyset,adLockOptimistic
with m_rs
.AddNew
.Fields(" ip")= AccountIP& " " ''x.Address
.Fields(" account")= Account& " " ''左$(x.Key,5)
.Fields(" DATEtime")= Now& "
.Fields(" name")= userver& "
。更新
结束
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
推荐答案
这篇关于在VB.NET中添加新内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!