如何恢复在MS Access失败后的ODBC连接 [英] How to restore ODBC connection after failure in MS Access

查看:489
本文介绍了如何恢复在MS Access失败后的ODBC连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有通过ODBC连接MS SQL Server数据库表的MS Access应用程序。当失去连接我收到ODBC错误3146连接后恢复体力,我仍然收到ODBC 3146错误。我一定要像重新连接到服务器。我怎样才能做到这一点在MS Access?

There is a MS Access application with tables on MS SQL Server linked through ODBC. When connection is lost i receive ODBC error 3146. After connection is restored physically i still receive ODBC 3146 errors. I have to make something like a reconnect to server. How can i do this in MS Access?

推荐答案

我认为,所有你需要做的就是刷新表链接。你问如何以编程方式重新链接表?你有没有试过被disconnnected并验证它解决了这个问题之后,清爽的联系?刷新在VBA中的链接会像

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.

这篇关于如何恢复在MS Access失败后的ODBC连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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