Famous UniDAC manual installation

Bo opened for the first time, write something. As the lazy, a lot of things, do not want to move. However, forget lazy not solve problems. Or hands-on, record it.

Well, the words go theme.

UniDAC manual installation.

Now Delphi, has been developed to XE6, it supports a variety of mobile devices, including Android, IOS, WinMobile, and all the original compiler, is not very exciting. Delphi is a Windows world, the fastest IDE development tool. Previously he has been described as "beautiful VB killer"! Of course, in the Linux world, before it is too Kylix, just update to Kylix3, after stops with the new, and it is a pity. You can not install (I have not installed successfully) on the high version CentOS6.4 or RedHat. However, it does not matter, Linux, you can also choose to Lazarus + FreePacal, although compared to Lazarus Delphi, a very unhappy with them, and that there is no way to do.

Why UniDAC, because it supports almost all platforms including Windows32, Windows64, FMX, Android, IOS; secondly, it supports almost all database drivers, including Oracle, DB2, MySQL, MSSQL, InterBase, PostgreSQL, SQLite, ASE, Access, etc., and high efficiency; in fact, the project line, run very stable. Former installation Delphi7, this time choose to install XE version. As a practical developers, of course, choose efficient and stable product. Of course, good things is a price to pay, but the installation instructions here, if you are working for a company, or buy genuine as well.

UniDAC, Version: 5.39, the download box on Delphi. Currently supports all versions Delphi5 above. Of course, also supports Lazarus.

 

In this case, my installation environment, Window7 + DelphiXE version (currently supports up to XE6). Download, the directory structure is as follows:

 

 So how to start installing it, make any event, we need a method. Since they do not know that, how to start, first look around, click Source, directory

 

 

晕了,这么目录,我选择XE版本,到底,我安装哪一个呢。现在Delphi发展到今天,已经有好多版本了。在Baidu一下,哪位仁兄,已经给出答案了。详细请看

http://www.wedelphi.com/Delphi-Version.html ,

 

 

看到了吗,Delphi15 对应 XE版本,Delphi19 对应XE5,那么Delphi20,对应XE6 ,不过,今天我选择在XE上安装。至于你问我为什么在XE安装,是因为以前的项目是在XE上,懒得在高版本上折腾了。呵呵,还是懒。

其实,如果养成好的习惯,根本,就不需要baidu. 我们要先看说明,然后才动手。

 

 如果,我们先看上面几个文档,就能非常容易知道,Delphi15 对应的XE版本。好了,我们打开ReadmeSrc.html,

 

 

 点击进去,因为选择源码编译,所以点击Using IDE 左边一栏,当然右边Using make-files ,也可以安装,不过这回还是动动手,一步一步来吧。

 

 

上面,已经写得非常详细了。相信,你稍微懂点English,都看得懂吧。我选择MySQL。当然安装其他比如Oracle 或  MSSQL驱动 都一样的。按着说明一步一步来。

第一步,先安装dac150.dpk. 打开XE IDE,打开  定位到 D:\XE-Project\3rd\UniDAC 5.39 d7-xe6 src\Source\Delphi15目录,选择dac150.dpk. 如下图:

,然后选择Build。

第二步,选择dacvcl150.dpk.在XE中,Build。如下图:

 

 第三部:,选择dcldac150.dpk.在XE中,Build。如下图:

 

 在这步,进行Build 的时候,出现错误提示:

 

 如上图,没有IdeConsts.inc,先不要着急,在下载的源码目录下,搜索一下,是否存在 这个文件。还好,文件是存在的,只是没有IDE,没有找到而已。如果没有找到,那说明,下载源码包,有问题。进入找到,那很好办,在IDE中间,Library指定源码位置,即可,如下图。

 

 第四步:选择unidac150.dpk,IDE中Build。如下图:

 

 第五步: 选择  unidacvcl150.dpk

 

 在安装的过程中,出现:

 

 

点击OK即可。

Build的时候,出现错误了。

 

 

 

意思 是说,找不到 vcl.Grahpics.dcu,不过还是不要着急啊。出现问题,分析问题,然后解决问题。这个vcl.Grahpics.dcu,是Delphi源文件,和UnDac没有关系。我们知道,从XE以后的版本(大概是吧,记不清楚了),单元的命名规则,稍有变动,比如以前Grahpics,现在现在命名为 vcl.Grahpics,这样,命名更加清晰。因为在Delphi 引入 FireMonkey后,Delphi实际上支持两种UI。一种以前老版本的VCL,一种就是FMX。所以,在XE6中,你会看到以这样的PAS单元。比如以前缀FMX开头。是为了区分。知道这么一层关系后,就知道怎么解决问题了。直接把 vcl. 去掉。 变成Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, 然后再编译。不过种暴力解决方式不是很好。如果哪天考虑到要在Xe6下安装,那岂不是又要加上。做好的解决方法,是添加编译条件。

如下 XE RTLVersion=22.00,改成 如下。

{$IF RTLVersion>22.00}
  Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls,
{$ELSE}
  Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls,
{$IFEND}

然后Build,通过。

第六部:dclunidac150.dpk,注意这一步,需要Build ,并且 Install要安装。

 

 Intall 后:

 

 

第七步:MySQL - myprovider150.dpk;,因为,我们只安装MySQl,所以选择 myprovider150.dpk. 当然要安装 Oralce的话,就按下列,对应选择。

 

Oracle - oraprovider150.dpk
Microsoft SQL Server - msprovider150.dpk
MySQL - myprovider150.dpk
InterBase and Firebird - ibprovider150.dpk
PostgreSQL - pgprovider150.dpk
SQLite - liteprovider150.dpk
NexusDB - nexusprovider150.dpk
ODBC - odbcprovider150.dpk
After you have compiled odbcprovider150.dpk, you can compile the following provider packages: 
Microsoft Access - accessprovider150.dpk
Sybase Advantage Database Server - adsprovider150.dpk
Sybase Adaptive Server Enterprise - aseprovider150.dpk
DB2 - db2provider150.dpk
DBF - dbfprovider150.dpk;

 

 然后,进行Build。表示已经安装成功了。

 

 

因为在 上面第二步,我们已经把源文件添加到库路径来。

那么为了,验证我们刚才安装是否成功。我们打开他们提供Demo。

 

 F9,运行,结果报错。如下:

 

 

通过分析,上面,很多我们没有安装 ,只安装了myprovider150.dpk,所以提示找不到。

那么,因为是Demo嘛,我们通过 暴力 方法解决,把不要的屏保掉。如下。当然   MySQLUniProvider 后面的 逗号 , 也要去掉。

 

{$IFNDEF CLR}
 // OracleUniProvider,
{$IFNDEF LINUX}
 // SQLServerUniProvider,
{$ENDIF}
 // InterBaseUniProvider,
  MySQLUniProvider
 // PostgreSQLUniProvider,
 // SQLiteUniProvider
{$IFNDEF LINUX}
 // ,ODBCUniProvider,
 // DB2UniProvider,
 // AccessUniProvider,
 // AdvantageUniProvider,
 // ASEUniProvider
{$ENDIF}

 

再次F9,运行 大功告成了。

 

 

 注意一点:中文乱码的解决方法,设置UniConnection属性specificOptions-->Options(页签中 Provider: 下列选择MySQL)-->UseUnicode 设置为 True,点击保存。如下图:

 

 

Guess you like

Origin www.cnblogs.com/jijm123/p/12002263.html