我在我的form中添加了一个ado控件,设置了它的连接字符串和recordsource,然后添加了一个datagrid控件与其关联,想在datagrid控件中显示数据,现在的问题是:我数据库表格中原有的数据可以正常显示,但是我用addnew增加的数据却显示不出来
我的代码如下:
Private Sub cmdAdd_Click()
Adodc1.Recordset.AddNew
Adodc1.Recordset.Fields("Name") = txtName.Text
Adodc1.Recordset.Fields("Number") = txtNumber.Text
Adodc1.Recordset.Fields("Department") = txtDepartment.Text
Adodc1.Recordset.Update
Adodc1.Refresh
End Sub
请高手指教
谢谢
我的代码如下:
Private Sub cmdAdd_Click()
Adodc1.Recordset.AddNew
Adodc1.Recordset.Fields("Name") = txtName.Text
Adodc1.Recordset.Fields("Number") = txtNumber.Text
Adodc1.Recordset.Fields("Department") = txtDepartment.Text
Adodc1.Recordset.Update
Adodc1.Refresh
End Sub
请高手指教
谢谢
请指教
谢谢