上面两位,我的程序是这样的,用Refresh的话,根本不能向数据库里写数据,用Recordset.requery则出错,请问是怎么回事?谢谢!!!!
Public c As IntegerPrivate Sub Command_new_Click()
c = c + 1
Adodc.Recordset.AddNew
Adodc.Recordset.Fields(0) = c
Adodc.Refresh
End Sub
Public c As IntegerPrivate Sub Command_new_Click()
c = c + 1
Adodc.Recordset.AddNew
Adodc.Recordset.Fields(0) = c
Adodc.Refresh
End Sub
c = c + 1
Adodc.Recordset.AddNew
Adodc.Recordset.Fields(0) = c
adodc1.recordset.update
adodc1.refresh
set mshflexgrid1.datasource=adodc1
End Sub
加了
adodc1.recordset.update
adodc1.refresh
就完全可以了!但是为什么只要update 或者只要refresh不行呢?
adodc1.recordset.update
adodc1.refresh
但为什么不直接用Adodb呢?