SQL server to Delphi

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
mskeels
Posts: 16
Joined: Tue 06 Mar 2012 15:08

SQL server to Delphi

Post by mskeels » Tue 06 Mar 2012 19:02

I read the FAQ.....

I've got the DevArt SDAC trial components installed and I am trying to establish a connection to the SQL server.

I'm using Delphi 7 with sql server 2008 standard R2. I would really appreciate a step by step tutorial on how to set up the connection; sql server is a brand new install and I am reading MSDN articles, but could really use a hand.

Does anyone have any suggestions, please?

Thanks you,
Mark

AndreyZ

Post by AndreyZ » Wed 07 Mar 2012 13:04

Hello,

To connect to SQL Server, you can use the following code:

Code: Select all

MSConnection.Server := 'server';
MSConnection.Username := 'username';
MSConnection.Password := 'password';
MSConnection.LoginPrompt := False;
MSConnection.Open;
If you cannot connect, please specify the exact error that occurs.

mskeels
Posts: 16
Joined: Tue 06 Mar 2012 15:08

Post by mskeels » Wed 07 Mar 2012 14:21

Well, I can connect with the Devart component now.

The problem was in the configuration of the MS-SQL server.

Remote access was not enabled, and a port in the server firewall was not open.

Thank you for responding,

Mark

AndreyZ

Post by AndreyZ » Wed 07 Mar 2012 14:51

It's good to see that you've found a solution. If any other questions come up, please contact us.

Post Reply