删除和更新问题 [英] delete and update proble

查看:81
本文介绍了删除和更新问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这样的代码:

私人 odbcTurnos20 As Odbc.OdbcConnection( " Dsn = dBase; DataSource =" + Me .path + " TURNOS20.dbf"

I have this code:

Private odbcTurnos20 As New Odbc.OdbcConnection("Dsn=dBase;DataSource=" + Me.path + "TURNOS20.dbf")

Dim h As 整数 = DataGridView1.SelectedRows(0).DataBoundItem.Row.Item( " HOJA"

Dim h As Integer = DataGridView1.SelectedRows(0).DataBoundItem.Row.Item("HOJA")

Dim i As 整数 = DataGridView1.SelectedRows(0 ).DataBoundItem.Row.Item( " ITEM"

Dim i As Integer = DataGridView1.SelectedRows(0).DataBoundItem.Row.Item("ITEM")

odbcTurnos20.Open()

odbcTurnos20.Open()

Dim DeletePrest = Odbc.OdbcCommand( "从TURNOS20.DBF删除WHERE HOJA =" _

Dim DeletePrest = New Odbc.OdbcCommand("DELETE FROM TURNOS20.DBF WHERE HOJA=" _

+ h.ToString + " AND ITEM =" + i.ToString + " ;;" ,odbcTurnos20)

+ h.ToString + " AND ITEM=" + i.ToString + ";", odbcTurnos20)

DeletePrest.ExecuteNonQuery()

DeletePrest.ExecuteNonQuery()

odbcTurnos20.Close()

它可以很好地删除(或升级),但是当我在DataGridView中再次执行SELECT时,删除(或修改)的行显示完好无损。但是,如果我用Access打开de table,那么注册表就不存在!!!

请帮帮我
谢谢

odbcTurnos20.Close()

It makes fine the deletion (or upgrade) but when I do the SELECT again in the DataGridView, the deleted (or modified) rows appears intact. But if I open de table with Access the registries aren't there!!!

Please help me
Thanks

推荐答案

您使用哪个ODBC驱动程序连接到数据库?是Jet,如果是,则Jet缓存内存中的更改大约5秒钟,如果在执行DELETE / UPDATE语句后立即查询数据库,则可能仍会获得旧数据。您可以尝试检查延迟5秒后是否检索到正确的数据吗?


这篇关于删除和更新问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆