Delphi 的多数据库访问
我已经使用 FirebirdSQL 10 年了,现在我有一位客户想要使用 MSSQL 2008。 我不想以此引发口水战,我只是想听听您对数据访问技术的建议。
我使用 Delphi MMVI。
使用本机 ADO 还是 DBExpress? 使用第三部分?
还有其他智慧的话吗?
谢谢,
是的,我知道我将不得不重写程序、触发器。我希望这值得...
I´m a 10 years FirebirdSQL user, and now i have a customer wanting to use MSSQL 2008.
I don´t want to start flame wars with this, i just want your advice on data access tecnology.
Im using Delphi MMVI.
Use native ADO or DBExpress?
Use third part?
Any other words of wisdom?
Thanks,
yes i know that i will have to rewrite procedures, triggers. I hope this worth...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
对于数据库组件,我从未见过比来自 DevArt (CoreLab) 的组件更快、更稳定的组件
。 UniDac 通用直接访问组件,支持(Oracle、SQL Server、MySql、InterBase/Firebird、PostgreSql和 ODBC(提供 DB2、Sybase MS Access 和任何其他 ODBC)
For database components, I have never seen faster and stable components than the components came from DevArt (CoreLab)
They have UniDac Universal direct access component, which support (Oracle, SQL Server, MySql, InterBase/Firebird, PostgreSql, and ODBC(which offers DB2, Sybase MS Access and any other ODBC)
虽然我每天都使用 SQLDirect 组件,但 AnyDAC 似乎是流行且开发良好的解决方案:http://www. da-soft.com/anydac/
Although I use SQLDirect components daily, AnyDAC seems to be popular and well developed solution: http://www.da-soft.com/anydac/
我已经使用优势数据库服务器编写了一个程序,并通过使用 ado 组件非常轻松地将其切换到 MSSQL。您可以使用 udl 文件指定 odbc 连接,以这种方式相对轻松地在两种不同的数据库类型之间切换。只要您使用简单的数据库连接,例如简单的 sql 语句或表,您就不会有太多的切换问题。如果您经常使用过程和触发器,这可能会更困难。
但是,我没有 dbexpress 的经验,所以不确定它的比较如何。
I have written a program using advantage database server and switched it to MSSQL very easily by using ado components. you can use a udl file to specify the odbc connection to switch between two different database types relatively easily that way. As long as you use simple database connections e.g. simple sql statements or tables you shouldn't have too much problem switching. It may be more difficult if you regularly use procedures and triggers.
however, I have no experience of dbexpress so not sure how it compares.
我会推荐 DBExpress。
I would recommend DBExpress.
我们在用于 SQL 的 DBExpress 和用于 Oracle 的 DOA 方面拥有非常好的经验。如果您使用 Oracle,DOA 是最佳选择(比 BDE 和 ADO 快得多)。
We've had very good experiences with DBExpress for SQL and DOA for oracle. If you're working with oracle the DOA is the way to go (is way faster than BDE and ADO).
您需要确保的是,无论您采用哪种解决方案,它都具有您想要的数据库以及您将来可能需要支持的数据库的驱动程序。
直到最近我们还使用 ODBCExpress,它很好地将 ODBC 包装到了 Delphi TDataSet 组件中,当然,每个数据库都有一个 ODBC 驱动程序。不幸的是,该产品不再受 Delphi 2009 的 Unicode 支持,因此它适用于 Delphi 2006,但如果您将来要迁移到更高版本的 Delphi,则不然。话虽如此,我正试图在其原始开发人员的帮助下将其升级到 D2009。
因此,ADO 将是一个显而易见的选择,因为大多数数据库也有 ADO 驱动程序,并且现在它通过 dbGo 组件成为 Delphi 的一部分。但看起来 dbExpress 很受欢迎并且很受欢迎,只要有驱动程序完全支持您选择的数据库,这似乎是最受欢迎的选择。
What you will need to ensure is that whichever solution you go with, it has the drivers for the databases you want and for the databases that you may potentially need to support in the future.
Until recently we used ODBCExpress, which did a very good job of wrapping the ODBC into Delphi TDataSet components, and of course every database going has an ODBC driver. Unfortunately this product is no longer supported with Delphi 2009's Unicode so it will be fine for Delphi 2006 but not if you will move to a later version Delphi at some point. Having said that I'm trying to get it moved up to D2009 with the help of its original developer.
ADO would therefore be an obvious choice as most databases also have an ADO driver and it is part of Delphi these days through the dbGo components. But it would appear that dbExpress is popular and well received and, as long as there are dirvers to fully support your databases of choice, this seems to be the most popular choice.
对我来说,ADO 是 MS SQL 的最佳选择。它是由微软开发的,非常稳定。您可以花时间采用更原生的方法,但我发现使用 ADO 构建的项目不需要进行很多(如果有的话)更改来支持 MSSQL Server 的各种版本。 ADO 还支持 ODBC 驱动程序,因此也可以访问旧数据库。甚至可以使用 ADO 获取一个逗号分隔的文件并对其进行查询,就好像它是一个表一样(尽管性能很糟糕,因为每个查询都会变成全表扫描)。
For me ADO makes the best choice for MS SQL. It was developed by Microsoft and is very stable. You could spend time going to a more native approach, but I have found that my projects built with ADO do not require many (if any) changes to support the various versions of MSSQL Server. ADO also has support for ODBC drivers, so legacy databases can also be accessed. It is even possible to take a comma delimited file and query it as if it was a table using ADO (although performance is horrible, since every query becomes a full table scan).