Firedac using UNIXODBC to connect to SQL Server
1) Download SQL SERVER ODBC DRIVER for 64-bit LINUX.
If you have an older version of the MSSQL tool installed, please remove any old UnixODBC package.
sudo yum remove unixODBC-utf16 unixODBC-utf16-devel
运行以下命令以安装mssql 工具使用 unixODBC 开发人员包
。
sudo yum install -y mssql-tools unixODBC-devel
2) Create an ODBC data source, configure the file in/etc/odbc.ini, and connect to the SQL Server database. Example:
[Sqlserver_sample]
Driver = Odbc-sql Server
Server = 127.0.0.1
User = sa
Password = pwd
Database = Yndb
3) Use ISQL to test the new ODBC data source. Example:
Cd/usr/local/yn/unixodbc/bin./isql.sh-v Sqlserver_sample
4) tfdconnection Connect SQL Server demo code via ODBC:
var rhconnection:tfdconnection;
。。。。。。
Rhconnection:=tfdconnection.create (nil); RHCONNECTION.PARAMS.ADD (' Driverid=odbc '); RHCONNECTION.PARAMS.ADD (' datasource=sqlserver_sample '); ODBC configuration name rhconnection.connected:=true;
Firedac using UNIXODBC to connect to SQL Server