使用 Oracle 的 ODBC 链接表登录 Access 2007

发布于 2024-08-23 12:17:11 字数 496 浏览 2 评论 0原文

我正在将Access 2003迁移到2007。有很多来自Oracle的链接表。我创建一个指向 Oracle 实例的 ODBC,然后在 Access 中通过 ODBC 链接所有表。我使用此代码登录,因此不会弹出“Oracle ODBC Driver Connect”对话框询问密码:

  strConnect = "ODBC;DATABASE=" & strFCPD & ";DSN=PBRIS;UID=xxxxx;PWD=xxxxx"
  Dim wsp As Workspace
  Set wsp = DBEngine.CreateWorkspace("xxx", "xxx", "xxx", dbUseODBC)
  Set dbs = OpenDatabase("", False, True, strConnect)   ' connect via regular ODBC
  dbs.Close

它在 2003 年工作正常,但在 2007 年不行。这里出了什么问题?我应该怎么办?

I'm migration Access 2003 to 2007. There are a lot of linked table from Oracle. I create a ODBC point to Oracle instance, then in Access I link all table through ODBC. I use this code login, so the "Oracle ODBC Driver Connect" dialog box would not popup to ask password:

  strConnect = "ODBC;DATABASE=" & strFCPD & ";DSN=PBRIS;UID=xxxxx;PWD=xxxxx"
  Dim wsp As Workspace
  Set wsp = DBEngine.CreateWorkspace("xxx", "xxx", "xxx", dbUseODBC)
  Set dbs = OpenDatabase("", False, True, strConnect)   ' connect via regular ODBC
  dbs.Close

It works fine in 2003 but not in 2007. What's wrong here? What should I do?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

柳絮泡泡 2024-08-30 12:17:11

Access 2007 使用与 Access 2003 不同的 ODBC 驱动程序吗?如果是这样,您需要创建一个使用 Access 2007 驱动程序的新 DSN。看起来现有的 DSN 名为“PBRIS”。进入 ODBC 管理器并使用管理工具的“系统 DSN”选项卡创建一个新的 DSN,并指定 Access 2007 驱动程序而不是 Access 2003 驱动程序。您可能想要以不同的方式命名它 - 也许类似于“PBRIS2007”。您需要更改构建连接字符串的代码以指定新的数据源名称。

我希望这有帮助。

Does Access 2007 use a different ODBC driver than Access 2003? If so you'll need to create a new DSN which uses the Access 2007 driver. It looks like the existing DSN is named "PBRIS". Go into the ODBC Administrator and create a new DSN using the System DSN tab of the administrator tool, and specify the Access 2007 driver instead of the Access 2003 driver. You'll probably want to name it differently - perhaps something like "PBRIS2007". You'll need to change your code which builds the connect string to specify the new data source name.

I hope this helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文