当前位置:Gxlcms > 数据库问题 > 使用unidac 在linux 上无驱动直接访问MS SQLSERVER

使用unidac 在linux 上无驱动直接访问MS SQLSERVER

时间:2021-07-01 10:21:17 帮助过:32人阅读

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 := 0 to fields.Count-1 do begin write(|); write( fields[i].FieldName); end; writeln(|); while not eof do begin for I := 0 to fields.Count-1 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 SQLSERVER

标签:using   classname   访问   oppo   -o   分享   ora   技术   lease   

人气教程排行