Connect to SQL Server from Service Application
Posted: Tue 25 Sep 2007 11:36
Hello,
We are using trial version of components for Delphi 5.
Two computer configuration in the domain: Developer computer and computer with SQL Server.
We have Service application on the developer computer.
In design mode we can connect to the SQL Server by setting in object inspector Connected := True on TMSConnection component. This works fine.
Trouble begin at attempting to start Service Application. The following code hang:
repeat
try
dbMain.Connected := true;
if dbMain.Connected then
Break;
except
on E: Exception do
begin
AddToLog('Connect failed with message: ' + E.Message);
end;
end;
sleep(5000); // 5 sec
inc(vCount);
Application.ProcessMessages;
until (vCount > (12 * 15)); // 15 min
The message that comes says: "Operation aborted".
Any ideas what is wrong?
Thank you very much.
Vladimir
We are using trial version of components for Delphi 5.
Two computer configuration in the domain: Developer computer and computer with SQL Server.
We have Service application on the developer computer.
In design mode we can connect to the SQL Server by setting in object inspector Connected := True on TMSConnection component. This works fine.
Trouble begin at attempting to start Service Application. The following code hang:
repeat
try
dbMain.Connected := true;
if dbMain.Connected then
Break;
except
on E: Exception do
begin
AddToLog('Connect failed with message: ' + E.Message);
end;
end;
sleep(5000); // 5 sec
inc(vCount);
Application.ProcessMessages;
until (vCount > (12 * 15)); // 15 min
The message that comes says: "Operation aborted".
Any ideas what is wrong?
Thank you very much.
Vladimir