使用ODBC链接到MySql时,MS Access表单不刷新 [英] MS Access form does not refresh when using ODBC link to MySql

查看:74
本文介绍了使用ODBC链接到MySql时,MS Access表单不刷新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个前端Access 2007数据库,它使用MySQL ODBC连接器连接到MySql表.

I have a front-end Access 2007 database connecting to MySql tables using MySQL ODBC connector.

问题是,如果数据由网络上的另一个用户更改或由弹出表单更改,则链接到表的表单将不会刷新其数据.

The problem is that a form linked to a table will not refresh its data if the data are changed by another user on the network or if the data was changed by a pop-up form.

如果我创建一个VBA代码来检测更改,然后刷新表单或重新查询,则以表格形式显示许多记录的表单将跳至其顶部,并且某些用户将看不到该记录与他们相关,因此必须向下滚动才能再次找到它,这并不总是那么容易.

If I create a VBA code which detects the change and then refresh the form or requery, then the form which shows many records in a table like format, will jump to its top, and some users will lose the sight of the record which is relevant to them and will have to scroll down to find it again which is not always easy.

以前,当我仅在网络上使用Access表时,如果数据发生更改,记录将在所有Access表单上更新,并且这些表单不会滚动回到顶部...

Previously, when I was using only Access tables on the network, records would be updated on all access forms if data would change, and the forms would not scroll back to the top...

如果MySql上的数据发生更改,是否有可能使Access表单自动刷新其行?

Is ti possible to make Access form autamaticaly refresh its row if data changed on MySql?

一种可能的解决方案是,刷新后我能否让表单滚动到完全相同的位置,但是不确定是否可以这样做...

One possible solution is if I could get the form to scroll to the exacly same position after the refresh, but not sure if this can be done...

推荐答案

检查Access应用程序中的ODBC刷新间隔.默认值为1500秒.较低的值可能会使您的表单在无需代码干预的情况下显示其更新的内容.

Check the ODBC refresh interval in your Access application. The default value appears to be 1500 seconds. Perhaps a lower value will allow your form to display its updated contents without code intervention.

Office按钮->访问选项->高级,然后在该部分选项结尾处找到ODBC刷新间隔.

Office button -> Access Options -> Advanced, then find ODBC refresh interval near the end of that section of options.

Office的较新版本 文件->选项->客户端设置->向下滚动到高级->更改ODBC刷新间隔(秒)

Newer Versions of Office File -> Options -> Client Settings -> Scroll down to Advanced -> Change ODBC refresh Interval (Sec)

此外,由于您已经创建了代码来检测服务器上的数据更改,然后作为响应刷新了表单,因此您可以为表单设置书签,刷新,然后返回到带有书签的表单行.

Also, since you have created code to detect data changes on the server, then refresh the forms in response, you could set a bookmark for the form, refresh, and then return to the bookmarked form row.

Recordset.Bookmark属性(DAO)

更新:将表单的记录集类型更改为动态集是解决该问题的关键.

Update: Changing the form's Recordset Type to Dynaset was the key to resolving this one.

这篇关于使用ODBC链接到MySql时,MS Access表单不刷新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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