Firedac using UNIXODBC to connect to SQL Server

Source: Internet
Author: User
Tags odbc mssql

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.