Recent

Author Topic: connecting to mssql server  (Read 4881 times)

rcmz

  • Jr. Member
  • **
  • Posts: 98
connecting to mssql server
« on: July 31, 2021, 07:28:13 pm »
hello to all,

I searched the forum for this question and did not find anything helpful.  :(

How can I connect to mssql server ?  %)

TIA
Ramiro

nouzi

  • Sr. Member
  • ****
  • Posts: 296
Re: connecting to mssql server
« Reply #1 on: August 01, 2021, 02:29:05 am »
Use zeosdb
My English is  bad
Lazarus last version free pascal last version
Lazarus trunk  free pascal trunk 
System : Linux mint  64bit  Windows 7 64bit

rcmz

  • Jr. Member
  • **
  • Posts: 98
Re: connecting to mssql server
« Reply #2 on: August 01, 2021, 05:09:30 am »
thx,

do you have a sample project ?

TIA
Ramiro

LacaK

  • Hero Member
  • *****
  • Posts: 691
Re: connecting to mssql server
« Reply #3 on: August 03, 2021, 07:54:46 am »
To connect to MS SQL Server you can use either:
  • native TMSSQLConnection
  • or TODBCConnection
both components are placed on sqlDB tab in Lazarus IDE

dseligo

  • Hero Member
  • *****
  • Posts: 1178
Re: connecting to mssql server
« Reply #4 on: August 03, 2021, 10:14:37 am »
do you have a sample project ?

I also use ZeosDBO for MSSQL. Put TZConnection on form or data module, set database, hostname, protocol and user properties in Object inspector. For protocol I use 'FreeTDS_MsSQL>=2005'. You'll also need library dll (try here: https://sourceforge.net/projects/zeoslib/files/3rd%20party/FreeTDS/).

Then set Connected property to true - if there are no errors you are connected.

 

TinyPortal © 2005-2018