在vb中怎样利用ado控件把记录保存到数据库?可不可以现在就帮帮我啊?

来源:百度知道 编辑:UC知道 时间:2024/06/05 05:50:50

DIM CONN AS STRING '连接字符传.在窗体添加一个ADO 控件
conn = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=" & "
With Adodc2
.ConnectionString = conn
.CommandType = 8
.RecordSource = "select * from TABLE "
.Refresh
.Recordset.AddNew
.Recordset.Fields("颜色") = Trim(Text1(0))
.Recordset.Fields("编号") = Label3.Caption
.Recordset.Update
End With