Using TADOConnection class to connect to SQL server 2005 db.
Having ConnectionTimeOut := 5; // seconds.
Trying to open the connection synchronously.
When
TADOConnection.ConnectionTimeout - Timeout in milliseconds to connect to data source TADOConnection.CommandTimeout - Timeout in milliseconds to execute command
if you getting timeout error on trying to connect, increase value of ConnectionTimeout property, else if you getting an error on executing some query, - increase value of CommandTimeout property.