Page 1 of 1

SQL server to Delphi

Posted: Tue 06 Mar 2012 19:02
by mskeels
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

Posted: Wed 07 Mar 2012 13:04
by AndreyZ
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.

Posted: Wed 07 Mar 2012 14:21
by mskeels
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

Posted: Wed 07 Mar 2012 14:51
by AndreyZ
It's good to see that you've found a solution. If any other questions come up, please contact us.