#1 2019-04-17 18:30:04

itSDS
Member
From: Germany
Registered: 2014-04-24
Posts: 506

Question - HowTo Connect to MS-SQL (SQL Server)

Some of my installations use Microsoft SQL Server as Backend. But cause of some mysterious Exception with TOleDBMSSQL2012ConnectionProperties i tried the Other Implementations for MS-SQL
First i have to say i get only 2 to work first the TOleDBMSSQL2012ConnectionProperties an second the TSQLDBUniDACConnectionProperties
In the UniDAC i don't get the Exception i get with the other (see here: https://synopse.info/forum/viewtopic.php?id=4971)

as described i tried to use The ZEOS Implementation but don'get it to work. The main reason is: i can't find working examples.
I wan't to replace

TOleDBMSSQL2012ConnectionProperties.Create(ADBSettings.Host, ADBSettings.Database, ADBSettings.Username, ADBSettings.Password);

with something like:

TSQLDBZEOSConnectionProperties.Create(TSQLDBZEOSConnectionProperties.URI(dMSSQL, ADBSettings.Host + ':' + ADBSettings.Port), ADBSettings.Database, ADBSettings.Username, ADBSettings.Password);

But it raises an Exception ntwdblib.dll not found. In the Documentation a 4 Interfaces which i can use OleDB, ADO, ODBC i tried different String instead of dMSSQL OleDB[mssql], ADO[mssql] but the error is driver not found.

can anybody pls make some working examples for the ZEOS uri to connect as stated above ?
What are the prerequisites
And last but not least what will be the best (fastest) way to connect to MS-SQL

Thank you in advance


Rad Studio 12.1 Santorini

Offline

#2 2019-04-19 15:45:09

miab3
Member
From: Poland
Registered: 2014-10-01
Posts: 188

Re: Question - HowTo Connect to MS-SQL (SQL Server)

This I use in the test PerfTest Delphi 10.3.1 Rio Zeos 7.3 svn5579:

    Test(TSQLDBZEOSConnectionProperties,TSQLDBZEOSConnectionProperties.URI('odbc_w[mssql]', '', ''),
      'DRIVER={SQL Server Native Client 11.0};Server=SERW\SQLEXPRESS;Database=master;Uid=sa;Pwd=**;MARS_Connection=yes',
      'sa','**',' ODBC_W MSSQL2012',false);

    Test(TSQLDBZEOSConnectionProperties,TSQLDBZEOSConnectionProperties.URI('OleDB[mssql]', '', ''),
     'Provider=SQLNCLI11.1;User ID=sa;Initial Catalog=master;Data Source=SERW\SQLEXPRESS;Password=**;MarsConn=Yes'
     ,'sa','**',' OleDB MSSQL2012',false);

Michal

Last edited by miab3 (2019-04-19 15:47:01)

Offline

Board footer

Powered by FluxBB