Ver Mensaje Individual
  #1  
Antiguo 30-12-2008
NasgulMA NasgulMA is offline
Registrado
 
Registrado: sep 2004
Posts: 4
Reputación: 0
NasgulMA Va por buen camino
Unhappy Servicio iniciado pero no hace nada

Hola a todos.
Antes que nada dar las gracias por ayudar a entender un poco mas este mundo maravilloso del delphi.

Bueno a lo que voy he creado e instalado un servicio en windows 2003 server que apartir de un fichero que esta en un sitio ftp actualiza una base de datos de SQL Server 2005. Funciona perfecto en el momento de instalarlo o si ejecuto el exe directamente pero al reiniciar el ordenador el servicio se inicia y si miro el administrador de tareas el exe se esta ejecutando pero no actualiza la base de datos es como si estubiera en pausa.

Este es el codigo del servicio a ver si alguien me puede decir que hago mal o darme alguna idea.


Código Delphi [-]
program ServicioRes1;
uses
  SvcMgr,
  SysUtils,
  Unit1 in 'Unit1.pas' {ServiceRes1: TService},
  UVariables in 'UVariables.pas';
{$R *.RES}
begin
  // Windows 2003 Server requires StartServiceCtrlDispatcher to be
  // called before CoRegisterClassObject, which can be called indirectly
  // by Application.Initialize. TServiceApplication.DelayInitialize allows
  // Application.Initialize to be called from TService.Main (after
  // StartServiceCtrlDispatcher has been called).
  //
  // Delayed initialization of the Application object may affect
  // events which then occur prior to initialization, such as
  // TService.OnCreate. It is only recommended if the ServiceApplication
  // registers a class object with OLE and is intended for use with
  // Windows 2003 Server.
  //
  // Application.DelayInitialize := True;
  //
  if not Application.DelayInitialize or Application.Installing then
    Application.Initialize;
  Application.CreateForm(TServiceRes1, ServiceRes1);
  Application.Run;
  while True do
  begin
    sleep(300000);
    ServiceRes1.ActualizarReservas;
  end;
end.

Bueno un saludo para todos.

Última edición por dec fecha: 30-12-2008 a las 11:42:54.
Responder Con Cita