在Access中使用ODBC [英] Using ODBC in Access

查看:116
本文介绍了在Access中使用ODBC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很喜欢我之前使用thescripts.com收到的快速回复。我想我会在这里问这个问题,因为到目前为止我还没有从Google搜索中获得好结果。


我正在尝试使用Access从另一个Access数据库中读取一个表,并从Oracle数据库中读取两个表。通过这些表格,我将执行一些SELECT选项。查询...我没有必要在任何外部表中进行任何更新或添加。


我无法在Access中找到有关如何执行此操作的良好在线教程/演练。我在管理工具 - >数据源(ODBC)中找到了一些关于设置ODBC连接的教程。菜单,但我不知道该怎么做或如何编码以在此之后使用Access中的连接。我相信我必须定义连接,打开连接,并获取我想要使用的Access和Oracle数据库中的表...但我确实遗漏了一些步骤。


请指出正确的方向。我很欣赏经验丰富的人的智慧。谢谢。

I have loved the quick responses that I have received using thescripts.com for a couple of my prior questions. I thought I would ask the question here as I haven''t been able to get a good result from my Google searches thus far.

I am trying to use Access to read a table from another Access database and read 2 tables from an Oracle database. With these tables I will be performing some "SELECT" queries... I have no need to make any updates or adds in any of the outside tables.

I have not been able to find a good online tutorial/walkthrough for how to do this within Access. I have found some tutorials on setting up the ODBC connection in the "Administrative Tools->Data Sources (ODBC)" menu, but am not sure what to do or how to code to use the connection within Access after that. I believe that I have to define the connection, open the connection, and grab the tables within the Access and Oracle databases that I want to use... but am for sure leaving out some steps.

Please point me in the right direction. I appreciate the wisdom from the more experienced. Thanks.

推荐答案




我正在做类似的事情。


我从我在Oracle数据库中想要的所有表开始,在MS Access的表部分中声明为外部链接表(使用ODBC)。这很简单,快速且易于使用,因为您可以将它们视为本地桌面(仅)来阅读。


但是,我发现安全限制必须给最终MDE的每个用户自己访问Oracle数据库意味着最好切换到使用具有唯一(和加密)用户代码/密码的连接字符串。


以下是我在程序中使用的一些代码的摘要。我正在使用MS Access 2003.你看到的任何地方都是XXXX。块我已经删除了一个字符串值,以保护无辜 - 你需要用适当的DSN值替换它,或者其他什么,无论如何... * grin *

显然有一些变量像pUsercode包含解密的用户代码等...

Hi,

I''m in the middle of doing something similar.

I started with all the tables I wanted from my Oracle database declared as external linked tables (using ODBC) in the table section of MS Access. That was simple, quick and easy to use, as you can treat them just as if they are a local table for reading (only) from.

But, I found that security constraints of having to give every user of the final MDE their own access to the Oracle database meant that it was better to switch to using a connection string with a unique (and encrypted) usercode/password.

Below is a summary of some of the code I use in my program. I''m using MS Access 2003. Anywhere you see an "XXXX" block I have removed a string value, to protect the innocent - You would need to replace it with the appropriate DSN value, or whatever, anyway... *grin*
And obviously some of the variables like pUsercode contain the decrypted usercode etc...


展开 | 选择 | Wrap | 行号


另一个智能且有用的响应Zwoker。坚持下去:)


我会看到你在遇到使用链接表的简单方法之前遇到过相同的问题。 ODBC链接差别很大,所以你可能不会受到同样的限制。


如果你这样做了,那么Zwoker很好地为你提前了解了这条道路。
Another intelligent and helpful response from Zwoker. Keep it up :)

I would see if you come across the same problems they have though, before abondonning the simpler way of using linked tables. ODBC links vary considerably, so you may not suffer the same restrictions.

If you do, then Zwoker has lit up the path ahead for you nicely.


Zwoker,


感谢您的提示。我将尝试使用链接表解决方案,然后尝试使用此解决方案,如果我遇到问题。


我正在为客户端(朋友)开发一个工具,链接到外部数据库。他们给了我一个临时Access数据库,它与共享驱动器上的数据库相同(我不在他们的网络上)。有没有办法在Access中设置一个链接表来查找要在我无权访问的共享驱动器上链接的文件,但是一旦该工具位于我客户的网络上就可以使用?我无法访问的Oracle表如何?我是否需要客户端在其Oracle服务器上设置任何内容才能使链接表正常工作?


感谢您的帮助!
Zwoker,

Thanks for the tip. I will try to use the link table solution and then try to use this solution if I run into problems.

I am developing a tool for a client (friend) that links to outside databases. They have given me a temporary Access database that is identical to a databases on their share drive (I am not on their network). Is there a way to set up a linked table in Access that looks for a file to link to on a share drive that I do not have access to, but will be available once the tool sits on my client''s network? How about the Oracle tables that I do not have access to. Will I need the client to set up anything on their Oracle server for the linked table to work correctly?

Thanks for all the help!


这篇关于在Access中使用ODBC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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