关于execute属性之后不能自动更新datagrid1的问题...
这个是我的程序Public conn As New ADODB.Connection
Public connectionstring As String
connectionstring = "provider=Microsoft.Jet.oledb.4.0;data source=default.mdb"
conn.Open connectionstring
Adodc1.connectionstring = connectionstring
conn.Execute "Update 测试记录 set 次数=55855 Where 编号='3'"
Adodc1.RecordSource = "select * from " & "测试记录"
Adodc1.Refresh
结果datagrid1中 编号为'3'的次数还是55,而不是55855,但是我用access打开时,表里面的数据已经改成了55855
然后我多加了一句:(就一切正常了)
Public conn As New ADODB.Connection
Public connectionstring As String
connectionstring = "provider=Microsoft.Jet.oledb.4.0;data source=default.mdb"
conn.Open connectionstring
Adodc1.connectionstring = connectionstring
conn.Execute "Update 测试记录 set 次数=55855 Where 编号='3'"
* conn.Execute "select * from 测试记录"
Adodc1.RecordSource = "select * from " & "测试记录"
Adodc1.Refresh
第一种情况是不是因为数据库的更新操作还没有提交就adodc1.refresh 了呢?
如何在conn.execute之后手动提交呢?
刚开始摸索VB,请各位老鸟见谅
补充:VB , 数据库(包含打印,安装,报表)