ZEOSDBO在delphi7中的安装(Delphi连接MySQL时可以用此组件)

在Delphi中,我们连接数据库一般是采用ODBC的连接方式或者使用Dbexpress来连接数据库,但是odbc方式连接时常常需要我们安装另外的ODBC组件,这里我们介绍一下ZEOSDBO控件的安装及使用方法:

(可从http://sourceforge.net/projects/zeoslib/下载)

首先,我们来看一下安装过程:

1.解压缩ZEOSDBO-6.6.5-stable.zip到c盘根目录,删除packages、src两文件夹外的其他文件夹;
2.删除packages文件夹中delphi7文件之外的其他版本文件夹;
3.运行delphi7,然后选择Component菜单中的New Component子菜单,在弹出的窗口中点击最下面的“Search path”一行中最后的“...”按钮,在随后弹出的“Directories”对话框中的最下面一行【“Greyed items denote invalid path”的下面】文本框中输入build路径“C:/ZEOSDBO-6.6.5-stable/packages/delphi7/build”,然后点击“Add”按钮,再点击“OK”,退出即可。
4.然后从“File”菜单中选择“Open Project”打开C:/ZEOSDBO-6.6.5-stable/packages/delphi7/ZeosDbo.bpg然后顺次编译以下文件:
1.   ZCore.bpl
2.   ZParseSql.bpl
3.   ZPlain.bpl
4.   ZDbc.bpl
5.   ZComponent.bpl
编译完成后在最下面的“ZComponentDesign70.bpl”上单击右键选择“Install”,提示安装成功后,重启Delphi7,即可看到控件栏中增加了一个“Zeos Access”标签。

接下来我们就可以进行数据库连接的操作使用了。

-----------------------------------------------------------------------------------------------------

补充:使用ZEOSDBO-7.0.2-rc时不能正确识别sqlite的utf-8编码的解决办法

在一个新建form中拖放ZConnection、ZTable、DataSource和DBGrid控件,依次连接着这几个控件的属性,并设置ZConnection连接对应的sqlite文件位置和sqlite.dll文件所在位置,设置连接数据库的协议为sqlite-3,打开连接;设置ZTable中的TableName选择绑定的数据表名,并激活ZTable,这时候能看到DBGrid中显示了对应的表的内容,但是会发现中文是乱码,解决的办法是:将ZConnection的AutoEncodStrings属性设置为true,再次连接和激活,即可正确显示数据库表中的中文内容。

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
02-23
ZeosDBO is a database middleware components for Borland development tools, including Delphi, C++ Builder and Kylix. The following compilers are supported: Delphi 5 - 7C++ Builder 5 - 6Kylix 2 - 3ZeosDBO supports direct connectivity to the following databases using the vendor provided, native interface: MySQL 3.20 - 4.1PostgreSQL 6.5 - 7.4Firebird 1.0 - 1.5Interbase 5.0 - 7.5Microsoft SQL Server 7, 2000Sybase ASE 12.0, 12.5Oracle 9iSQLite 2.8For other databases we propose to use implemented Active Data Objects (ADO) Bridge. Advantages of using ZeosDBO: Platform independance. The ZeosDBO is highly generic. Applications written in ZeosDBO can be migrated across databases without major changes. ZeosDBO is open source, written for usability and extensibility. ZeosDBO leverages the amazing power of the Delphi development environment without relying on a performance killing middleware. ZeosDBO is an extremely thin abstraction layer, unlike ‘thick‘ layered protocols like ADO and BDE. Package contents: ZCore - Core classes and interfaces. Contains Java style objects and collections as well as compatibility types and functions. ZParseSql - SQL specific for syntax and lexical analysis. ZPlain - Native plain API to supported SQL servers. ZDbc - Port of Java Database Connectivity API (JDBC 2.0). DBC API acts as intermediate layer between Plain API and highlevel TDataset or DBExpress components. ZComponent - visual components descended from TDataset. Installed components: TZConnection: This component encapsulates the database connection and transaction management. TZReadOnlyQuery: TDataset component to execute SQL queries and process data in read-only mode. TZQuery: TDataset component which allows data modifications in regular and cached mode. TZUpdateSQL: Analog of standard TUpdateSQL component to explicite definition of Insert/Update/Delete SQL statements for TDataset modifications. TZStoredProc: The component to execute SQL stored procedures. TZSQLProcessor: The component to execute SQL scripts for different SQL and various delimiter types. TZSQLMonitor: The component to monitor all outgoing SQL queries and other logging information. TZSQLMetadata: Specialized TDataset component which provides an access to database metadata such as tables, columns, indices, etc.
要在Delphi 2007安装zeosdbo-7.1.4-stable,您需要按照以下步骤进行操作: 1. 首先,您需要从Zeos官方网站(https://sourceforge.net/projects/zeoslib/files/)下载zeosdbo-7.1.4-stable的安装文件。 2. 下载完成后,解压缩安装文件并找到Delphi 2007所在的安装目录。 3. 将解压后的文件复制到Delphi 2007的安装目录的相应文件夹下。通常,您可以将这些文件复制到Delphi 2007的安装目录下的"Library"文件夹,或者根据您的喜好将其复制到其他文件夹。 4. 打开Delphi 2007,创建一个新的项目或打开一个已有的项目。 5. 单击Delphi 2007的"工具"菜单并选择"安装组件"。 6. 在"安装组件"对话框,单击"添加"按钮。 7. 浏览到Delphi 2007安装目录下的zeosdbo-7.1.4-stable文件夹,并选择其的"ZComponents_Dxx.bpl"文件("Dxx"表示您所使用的Delphi版本,例如"D10"表示Delphi 10)。 8. 单击"打开"按钮,并在"安装组件"对话框再次单击"添加"按钮。 9. 浏览到Delphi 2007安装目录下的zeosdbo-7.1.4-stable文件夹,并选择其的"ZCore_Dxx.bpl"文件。 10. 单击"打开"按钮,然后单击"确定"按钮开始安装组件。 11. 安装完成后,您可以在Delphi 2007的组件面板找到zeosdbo-7.1.4-stable组件。您可以将其拖放到您的项目窗口,并使用其功能开发数据库应用程序。 这样,您就成功在Delphi 2007安装zeosdbo-7.1.4-stable组件。您可以利用这个组件开发出更加强大和功能丰富的数据库应用程序。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值