我的应用程序如何同时使用 MS Access 数据库和 SQL Server 数据库?

发布于 2024-08-20 21:47:53 字数 239 浏览 2 评论 0原文

您使用了哪些策略和技术来生成需要访问多个不同数据源的数据驱动应用程序?具体来说,是 Microsoft Access 和 SQL Server。理想情况下,我想创建一个抽象层,对应用程序隐藏物理数据源。

像 ADO.NET Entity Framework 这样的东西是理想的,但它没有 MS Access 提供程序。是否有不同的框架或技术支持同时访问和 SQL Server 连接?

为实体框架创建一个访问提供程序需要做多少工作?

What strategies and techniques have you used to produce a data driven application that needs to access multiple diverse data sources? Specifically, Microsoft Access and SQL Server. Ideally, I'd like to make an abstraction layer that hides the physical data source from the application.

Something like the ADO.NET Entity Framework would be ideal, but it doesn't have an MS Access provider. Is there a different framework or technique that supports simultaneous Access and SQL Server connections?

How much work would it be to make an Access provider for the Entity Framework?

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

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

发布评论

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

评论(4

宁愿没拥抱 2024-08-27 21:47:53

我非常确定 LLBLGen 支持 Access(当然,它也支持 MS SQL)。虽然它需要花钱,但恕我直言,它是 .NET 的最佳 OR/M。

I'm pretty sure LLBLGen supports Access (and, of course, it supports MS SQL). It costs money though, but IMHO it's the best OR/M for .NET.

逆流 2024-08-27 21:47:53

另一种方法是在 SQL Server 中创建链接服务器,使用 SQL Server 中的视图执行联接,并完全隐藏应用程序中存在多个数据源的事实。

Another approach is to create Linked Servers in SQL Server, perform joins using views in SQL Server and completely hide the fact there are multiple data sources from your application.

巷子口的你 2024-08-27 21:47:53

据我所知,只有两种选择:

  1. 多个连接字符串
  2. 单个连接字符串。

在第一种情况下,您可以在中间层代码中加入来自不同源的任何所需数据。在第二种情况下,您可以通过一个源间接访问除一个源之外的所有源。例如,您可以通过 SQL Server 中的链接服务器从 Access 检索数据。

它们各有优点和缺点。使用单个连接字符串在中间层进行编码肯定更简单。最终这取决于两个来源的需要。例如,如果一个只是用于日志记录,那么两个连接字符串可能会更简单。如果需要联接等,那么根据来源,使用链接服务器可能会更容易。如果源之一是 Access 并且您没有使用 Access 安全性,则使用链接服务器可以正常工作,具体取决于规模。如果您使用Access security并且有不同的登录名需要访问数据库,那么使用链接服务器将是一件痛苦的事情。

As far as I know, there are only two choices:

  1. Multiple connection strings
  2. Single connection string.

In the first scenario, you join any data you need from the disparate sources in the middle tier code. In the second scenario, you access all sources but one indirectly through the one source. For example, you'd retrieve data from Access via a Linked Server in SQL Server.

They each have their advantages and disadvantages. Using a single connection string is certainly simpler to code against in the middle-tier. Ultimately it depends on the need of two sources. If one is simply for logging for example, then two connection strings might be simpler. If joins and such are needed, then using a linked server might be easier depending on the sources. If one of the sources is Access and you are not using Access security, then using a Linked Server can work fine depending scale. If you are using Access security and have different logins that need to access the database, then using a linked server will be a pain.

梦在深巷 2024-08-27 21:47:53

看看NHibernate。它有 SQL Server 和 Access(以及其他)的提供程序。

Look at NHibernate. It has providers for SQL Server and Access (and others).

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