How to restore ODBC connection after failure in MS Access

你。 提交于 2019-12-02 00:42:31
BPCS

I think all you need to do is refresh the table links. Are you asking how to relink the tables programmatically? Have you tried refreshing the links after being disconnnected and verified that it solves the problem? Refreshing the link in VBA would be something like

Dim db as Database
Set db = Currentdb()
db.TablesDefs(1).RefreshLink

You may have to loop thru the tables to get the index I am not sure if it will take the table name but you could try it that way first.

Where is your Access table in reference to your SQL Server? If your Access table is local and you are the only one using it then refreshing table links is sufficient. However, if the Access db lives on a server or some other shared space where many people are using it they will not be able to access the SQL tables if you are using a USER DSN. Setting up a system DSN or a dsn file will provide Access with the information it is looking for as to where the SQL tables are.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!