* * *

Author Topic: TODBCConnection and MSSQL Server  (Read 451 times)

Deepaak

  • Sr. Member
  • ****
  • Posts: 420
TODBCConnection and MSSQL Server
« on: October 12, 2017, 08:50:22 am »
How to connect MSSQL Server using TODBCConnection using Connection String

Code: Pascal  [Select]
  1. DRIVER={SQL Server};SERVER=DEMO-PC\\SQLEXPRESS;DATABASE=master;UID=sa;PWD=demo;

Using Lazarus 1.9
Ooops Holiday season is offline now.

vertnik

  • New member
  • *
  • Posts: 6
Re: TODBCConnection and MSSQL Server
« Reply #1 on: October 12, 2017, 02:14:52 pm »
Like this:

ODBCConnection1.Driver:='SQL Server';
ODBCConnection1.UserName:='sa';
ODBCConnection1.Password:='demo';
ODBCConnection1.Params.Add('Database=master');
ODBCConnection1.Params.Add('Server=DEMO-PC\\SQLEXPRESS');
ODBCConnection1.Open;   

vertnik

  • New member
  • *
  • Posts: 6
Re: TODBCConnection and MSSQL Server
« Reply #2 on: October 13, 2017, 07:54:02 am »
You can also check this web site:

http://wiki.freepascal.org/ODBCConn

Deepaak

  • Sr. Member
  • ****
  • Posts: 420
Re: TODBCConnection and MSSQL Server
« Reply #3 on: October 14, 2017, 06:20:25 am »
Thanks! It Works!!!!!!!!
Ooops Holiday season is offline now.

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus