Recent

Author Topic: Lazarus with sql server  (Read 8727 times)

diegolaquino

  • Newbie
  • Posts: 2
Lazarus with sql server
« on: January 17, 2017, 02:58:49 am »
Hi, i need help. I'm begginer and i am having problems with lazarus and sql server, i'd like to know if anybody have a article step by step for this? thank you

kapibara

  • Hero Member
  • *****
  • Posts: 610
Lazarus trunk / fpc 3.2.2 / Kubuntu 22.04 - 64 bit

dbots

  • Newbie
  • Posts: 6
Re: Lazarus with sql server
« Reply #2 on: January 24, 2017, 07:41:49 pm »
First you should create an ODBC filedsn, using ODBC FileDSN wizard.
Then, you place on a form an ODBC connection and SQLQuery component.
Connect SQLQuery with ODBCConnection (Database property)
On ODBCConnection set the FileDSN property to the full path where your dsn file exists.
Finally use "Open" and "Close" methods to Connect / Disconnect and "Connected" property to check if you are connected.
It works like a charm !

 

TinyPortal © 2005-2018