简体   繁体   English

delphi 中的 ADO 组件

[英]ADO components in delphi

I am currently using BDE components to connect to a database in Delphi 5 professional version.我目前正在使用BDE组件连接Delphi 5专业版中的数据库。 My problem is that BDE components need BDE Administator to run the application on another machine.我的问题是 BDE 组件需要 BDE 管理员才能在另一台机器上运行应用程序。 So I am planning to buy a new version of Delphi which contains ADO components.所以我打算购买一个包含 ADO 组件的新版本 Delphi。

Question: Are ADO components also having issues like the BDE?问题:ADO 组件是否也存在 BDE 之类的问题? Do ADO components need any specific setup to run applications on another machine? ADO 组件是否需要任何特定设置才能在另一台机器上运行应用程序?

Thanks for the help.谢谢您的帮助。

All the components have issues in some point, in the case of ADO is very stable, but you can have some specific problems with the providers (like the infamous not support for blob fields in ORACLE using the Microsoft provider) but certainly is more recommendable use ADO instead of the deprecated BDE .所有组件在某些方面都有问题,在ADO非常稳定的情况下,但是您可能会遇到一些特定问题与提供程序(例如臭名昭著的不支持 ORACLE 中使用 Microsoft 提供程序的 blob 字段)但当然更推荐使用ADO 而不是deprecated BDE About the dependencies, ADO uses providers to connect to the RDBMS, most of them are installed by MDAC (Microsoft Data Access Components) which is included in most of the Windows versions.关于依赖关系,ADO 使用提供程序连接到 RDBMS,它们中的大多数是由大多数 Windows 版本中包含的MDAC(Microsoft 数据访问组件)安装的。 So in most cases you will not need install any addtional component , at least which you want use a provider not inluded in MDAC like MySql, Firebird or others.因此,在大多数情况下,您不需要安装任何附加组件,至少您希望使用未包含在 MDAC 中的提供程序,例如 MySql、Firebird 或其他。

Sounds like if you posted two times the (almost) same question ... with more focus on ADO this time.听起来如果您发布了两次(几乎)相同的问题……这次更关注 ADO。

As was written in the previous question, if you attempt to connect to an Oracle database using ADO or OleDB, you'll find out that all OleDB providers are buggy for handling Oracle BLOBs: Microsoft's version just do not handle them, and Oracle's version will randomly return null for 1/4 of rows ... So IMHO ADO or OleDB are not a serious option for accessing Oracle database.如上一个问题所述,如果您尝试使用 ADO 或 OleDB 连接到 Oracle 数据库,您会发现所有 OleDB 提供程序在处理 Oracle BLOB 时都存在错误:Microsoft 的版本不处理它们,Oracle 的版本将随机返回 null 的 1/4 行......所以恕我直言 ADO 或 OleDB 不是访问 Oracle 数据库的重要选项。 :( :(

And if your purpose is to get rid of the BDE installation, you'll find out that the Oracle's OleDB provider is quite huge and that the BDE is much light and better... A standard Oracle's client installation containing the OleDB/ADO provider (which is not installed in the "Light" version of the Oracle's clients), needs a.zip setup of about 660 MB...如果您的目的是摆脱 BDE 安装,您会发现 Oracle 的 OleDB 提供程序非常庞大,而且 BDE 更轻巧更好……包含 OleDB/ADO 提供程序的标准 Oracle 客户端安装(没有安装在 Oracle 客户端的“Light”版本中),需要大约 660 MB 的.zip 设置...

On real database data, I found out our Open Source direct access to Oracle to be 2 to 10 times faster than the OleDB provider, without the need to install this provider (nor the BDE).在真实的数据库数据上,我发现我们的开源直接访问 Oracle比 OleDB 提供程序快 2 到 10 倍,无需安装此提供程序(也不需要安装 BDE)。 You can even use the Oracle Instant Client provided by Oracle which allows you to run your applications without installing the standard (huge) Oracle client or having an ORACLE_HOME.您甚至可以使用 Oracle 提供的Oracle 即时客户端,它允许您在不安装标准(巨大)Oracle 客户端或拥有 ORACLE_HOME 的情况下运行您的应用程序。 Just deliver the dll files in the same directory than your application, and it will work.只需将 dll 文件与您的应用程序放在同一目录中,它就可以工作。

Of course, this is full Open Source, and works from Delphi 5 up to XE.当然,这是完全开源的,适用于从 Delphi 5 到 XE。 So when your project may upgrade to a newer Delphi version, it will work.因此,当您的项目可能升级到更新的 Delphi 版本时,它将起作用。 You are not tied to non-Unicode Delphi 5-Delphi 7 version of Oracle components, as you can found on Torry's , eg but those components may help you get rid of the BDE installation for an existing project.您不依赖于非 Unicode Delphi 5-Delphi 7 版本的 Oracle 组件,您可以在 Torry's 上找到,例如,但这些组件可以帮助您摆脱现有项目的 BDE 安装。

If you don't use BLOBs in your database, you can use ADO.如果您在数据库中不使用 BLOB,则可以使用 ADO。 In this case, my advice is to read this post , and use TADODataset , which is available in Delphi 5.在这种情况下,我的建议是阅读这篇文章,并使用TADODataset 5 中提供的 TADODataset。

Ok Naren, since you are on Oracle you can use this Oracle driver DOA .好的 Naren,因为您使用的是 Oracle,您可以使用此 Oracle 驱动程序DOA We use it exclusively in our Delphi projects.我们在 Delphi 项目中专门使用它。

All our Delphi projects are on Delphi 7 but we are converting all of it to Delphi XE now.我们所有的 Delphi 项目都在 Delphi 7 上,但我们现在将其全部转换为 Delphi XE。 When using DOA you do need to install the Oracle client libraries on the client machine.使用 DOA 时,您确实需要在客户端计算机上安装 Oracle 客户端库。 The upside is speed and Oracle support, so the DOA drivers don't need to work on the most common command set like ADO needs to, so the Oracle support is brilliant.好处是速度和 Oracle 支持,因此 DOA 驱动程序不需要像 ADO 那样处理最常见的命令集,因此 Oracle 支持非常出色。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM