使用unidac 在linux 上无驱动直接访问MS SQL SERVER
随着delphi 10.2 开始了对Linux 的重新支持。devart 也迅速的发布了unidac 7.0,
最大的特性就是支持linux和MongoDB.
并有了其他更新:
In this release we added such significant features as:
- The new UniDAC version includes a new MongoDB provider which allows you to work with a cross-platform document-oriented database MongoDB. Its main features are high performance, easy deployment and comprehensive support for the latest versions of the MongoDB server.
- In DBF provider, we added support for the Direct mode. Using DBF data provider, you can work with a variety of database formats: dBaseIII-dBase10, dBase for Windows, HiPer-Six, FoxPro 2, Visual FoxPro.
- Now, working with Oracle in the Direct mode becomes more appealing, we supported Oracle 12c authentication, Oracle Cloud (DbaaS), Oracle Encryption, Oracle Data Integrity. We also added support for the ANYDATA type.
- What is more, for Interbase and Firebird, you have an opportunity to manage batch operations using a transaction and to obtain an active transaction number using DBMonitor.
- In NexusDB data provider, we added support for using ConnectionString and the TFmtBCD fields.
更多的情况可以访问官网www.devart.com .此公司在数据库存取方面的功力,已经逆天。
今天给大家说的是利用undiac 的直连数据库功能,在Linux下不安装任何驱动,访问MS SQLSERVER 功能。
如果你没有现成的sql server 数据库,可以直接在微软的网页上下载sql server 2016 express 版,此版本为免费版本。
安装后,启动TCP/IP 支持,同时注意windows 防火墙的设置,确保网络访问正常。
在windows 上,使用客户端程序,建立一个sql server 数据库,同时建一个测试表。

输入一些测试数据

OK, 准备结束。启动delphi。
新建一个控制台工程。

再建一个datamodule

放上对应的控件

注意uniconnection 的属性设置


ok, 设置完毕
回到主程序。
program linuxdata;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils,System.Classes,
dmp in 'dmp.pas' {dmf: TDataModule};
var
i:integer;
s:string;
begin
try
dmf:=Tdmf.Create(nil);
dmf.UniConnection1.Connected:=true;
writeln('数据库版本:'+dmf.UniConnection1.ServerVersionFull);
with dmf.cx do
begin
SQL.Clear;
sql.Add('select * from TB_user');
open;
for I := to fields.Count- do
begin
write('|');
write( fields[i].FieldName);
end;
writeln('|');
while not eof do
begin
for I := to fields.Count- do
begin
write('|');
write( fields[i].AsString) ;
end;
writeln('|');
next;
end;
end;
writeln('打完收功!');
readln;
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
end.
在windows 上运行无误。

添加linux 平台编译支持

编译,运行程序

结果出来了。与windows 下没任何区别。
记住:我们没有在linux 下安装任何sql server 驱动。
用delphi 就这么自信!
另外,以上人名,纯属虚构,如有雷同,爱理不理。
使用unidac 在linux 上无驱动直接访问MS SQL SERVER的更多相关文章
- (provider: 共享内存提供程序, error: 0 - 管道的另一端上无任何进程。) (Microsoft SQL Server,错误: 233)
------------------------------ 无法连接到 IFCA-LIUWEI/SQL2005. ------------------------------其他信息: 已成功与服务 ...
- sql server 2008启动时:已成功与服务器建立连接,但是在登录过程中发生错误。(provider:命名管道提供程序,error:0-管道的另一端上无任何进程。)(Microsoft SQL Server,错误:233) 然后再连接:错误:18456
问题:sql server 2008启动时:已成功与服务器建立连接,但是在登录过程中发生错误.(provider:命名管道提供程序,error:0-管道的另一端上无任何进程.)(Microsoft S ...
- Linux下使用FreeTDS访问MS SQL Server 2005数据库(包含C测试源码)
Linux下使用FreeTDS访问MS SQL Server 2005数据库(包含C测试源码) http://blog.csdn.net/helonsy/article/details/7207497 ...
- .net core连接Liunx上MS SQL Server
场景 由于业务要求,需要对甲方的一个在SQL Server上的财务表进行插入操作.研究了半天,因为一个小问题折腾了很久. 过程 .net core端: 1. 利用EF,就需要的导入相关的Nuget包, ...
- XVFB实现selenium在linux上无界面运行安装篇
selenium在linux上无界面运行,其实是非常简单的.具体的方法有使用HtmlUnitDriver或者PhantomJSDriver,有时间我会写写关于这两个东东的文章,其实基本和ChromeD ...
- Linux上通过MySQL命令访问MySQL数据库时常见问题汇总
Linux上通过mysql命令访问MySQL数据库时常见问题汇总 1)创建登录账号 #创建用户并授权 #允许本地访问 create user 'test'@'localhost' identified ...
- TQ2440学习笔记——Linux上I2C驱动的两种实现方法(1)
作者:彭东林 邮箱:pengdonglin137@163.com 内核版本:Linux-3.14 u-boot版本:U-Boot 2015.04 硬件:TQ2440 (NorFlash:2M Na ...
- Linux上实现Windows的SQLPlus保存SQL历史记录功能
在Windows操作系统上,当在DOS命令窗口中运行SQL*Plus的时候,可以使用向上,向下键来跳回之前已经执行过的SQL语句.你可以根据需要修改他们,然后按Enter键重新提交执行. 然而,当在L ...
- Linux上 Can't connect to X11 window server using XX as the value of the DISPLAY 错误解决方法
在Linux上运行需要图形界面的程序时出现如下错误提示: No protocol specified Exception in thread "main" java.awt.AWT ...
随机推荐
- pta l2-5(集合相似度)
题目链接:https://pintia.cn/problem-sets/994805046380707840/problems/994805070149828608 题意:求两个集合的相同的不同元素的 ...
- Myeclipse安装完配置
1.Window --> preferences --> 搜索tomcat --> Tomcat7.x --> 选择Enable并导入tomcat所在目录2.Window -- ...
- echarts中国地图散点涟漪效果
echarts中国地图例子:http://gallery.echartsjs.com/editor.html?c=effectScatter-map 代码: var data = [{ name: ' ...
- macOS 升级后重装命令行工具的问题
问题背景 最近升级个人macbook 从 10.13 到 10.14 在终端输入 git 不能用了,发现是重装操作系统后原来的 Command Line Tools 被自动卸载了, 采用 xcode- ...
- Java11-java基础语法(十)类设计综合案例
Java11-java语法基础(十)类设计综合案例 一.类综合设计方法 1.类设计步骤 (1)分析数据成员 (2)分析成员方法和构造方法 (3)画出类图 (4)编码测试 2.具体问题 1)分析数据成员 ...
- python string tuple list dict 相互转换的方法
dict = {'name': 'Zara', 'age': 7, 'class': 'First'}# 字典转为字符串,返回:<type 'str'> {'age': 7, 'name' ...
- 11.2JS笔记
1.为什么要面向对象:JS一开始就是写网页特效,面向过程,作者发现这样的写不好,代码重复利用率太高,计算机内存消耗太大,网页性能很差,所以作者就受到java和c语言的影响,往面向对象对齐,JS天生有一 ...
- ---转载---phython资料
整理汇总,内容包括长期必备.入门教程.练手项目.学习视频. 一.长期必备. 1. StackOverflow,是疑难解答.bug排除必备网站,任何编程问题请第一时间到此网站查找. https://st ...
- kubadm创建k8s v1.10集群
kubadm创建k8s集群 1:服务器信息以及节点介绍 主机名 ip 备注 k8s-master 192.168.0.104 master etcd keepalived k8s-client1 19 ...
- (转找了好久)实现一个2008serve的IIS的虚拟目录(通过网络路径(UNC)的形式,共享在另外一个2008服务器上
目的:实现一个2008serve的IIS的虚拟目录(通过网络路径(UNC)的形式,共享在另外一个2008服务器上) 准备工作 1.共享资源服务器为 ShareServer,IP地址为:192.168. ...