作为 SQL Server 前端访问 - ADO 与 DAO?
我有一个项目将使用Access 2003作为前端,数据将存储在SQL Server中。 Access 将通过链接表与 SQL Server 中的所有数据库逻辑(存储过程、视图)连接到 SQL Server。
鉴于此设置,在 Access 中使用 ADO 或 DAO 会更好吗?这只是一个偏好问题还是更适合 Access 作为前端和 SQL Server 作为数据存储?特别是在使用链接表时。谢谢。
I have a project that will be using Access 2003 as the front-end and the data will be stored in SQL Server. Access will connect to SQL Server via linked tables with all the database logic (stored procedures, views) within SQL Server.
Given this setup, would it be better to use ADO or DAO within Access? Is it just a matter of preference or is one more suited to Access as a front-end and SQL Server as the data store? Especially when using linked tables. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用带有 ODBC 链接表的 MDB。由于您使用的是 ODBC,并且通过 Jet 连接,因此很明显 DAO 是数据访问的默认选择。
ADO 应该只用于那些无法通过其他方式完成或性能不佳的事情。
简而言之,您构建 SQL Server 应用程序就像构建纯 Access 应用程序一样(假设您构建一个具有 Jet/ACE 后端的应用程序以高效检索数据,这应该是理所当然的),并且仅求助于服务器当默认的 Access 方法效率低下或无法获得所需的结果时(例如,在返回记录集的存储过程中的可编辑记录集),可以使用端功能或 ADO。
Use an MDB with ODBC linked tables. Because you are using ODBC, you are connecting via Jet, so it's obvious that DAO is the default choice for data access.
ADO should be used only for those things that can't be done otherwise, or that are performing poorly.
In short, you build your SQL Server app just like you would a pure-Access app (assuming you build an app with a Jet/ACE back end to retrieve data efficiently, which should be a no-brainer), and only resort to server-side functionality or ADO when the default Access approach is inefficient or doesn't get the result you need (e.g., an editable recordset in the case of recordset-returning sprocs).
编写直通查询而不是链接表方法。性能将会得到很大的提高。编写 Access 应用程序?
创建一些本地表来存储一些查询结果。您可以根据需要动态更改直通查询以及连接到多个数据库的连接信息。
编辑:普遍共识是 ADO 用于连接到 sql server/其他源,DAO 用于仅 mdb 源。
Write pass-thru queries as opposed to the linked table approach. Performance will be greatly improved. Writing an Access app?
Create some local tables to store some query results. You can dynamically change the pass-thru queries as needed as well as connection info for connecting to multiple databases.
Edit: General consensus is ADO for connecting to sql server/other sources and DAO for mdb only sources.
DAO 用于从任何 COM 应用程序访问 MDB 数据库。我不相信它甚至可以连接到 SQL Server。
ADO 是 DAO 的继承者。 ADO 可以连接到许多数据库,但与 SQL Server 的交互效果尤其好。因此,在您的情况下,使用 ADO 似乎是理所当然的。
DAO was used to access MDB databases from any COM application. I don't believe it can even connect to SQL Server.
ADO is a successor of DAO. ADO can connect to many databases, but interacts especially well with SQL Server. So in your situation, using ADO seems like a no brainer.