Icon AddServerEvent Method

procedure AddServerEvent(const EventName: String; const
      EventDescription: String; EventRunType: TEventRunType;
      EventStartDate: TDateTime; EventEndDate: TDateTime;
      EventStartTime: TDateTime; EventEndTime: TDateTime;
      EventInterval: Word; EventDays: TEventDays; EventDayOfMonth:
      TEventDayOfMonth; EventDayOfWeek: TEventDayOfWeek; EventMonths:
      TEventMonths)

Usage

Call the AddServerEvent method to add a new scheduled event to a database server. Use the EventName parameter to specify the new event name, the EventDescription parameter to give it a description, the EventRunType parameter to specify how the event should be run, the EventStartDate and EventEndDate parameter to specify the dates during which the event should be run, the EventStartTime and EventEndTime parameters to specify the time of day during which the event can be run, the EventInterval to specify how often the event should be run (actual interval unit depends upon the EventRunType, and the EventDays, EventDayOfMonth, EventDayOfWeek, and EventMonths parameters to specify on what day of the week or month the event should be run. The following describes which parameters are required for each possible EventRunType value (all run types require the EventStartDate, EventEndDate, EventStartTime, and EventEndTime parameters):

Run TypeParameters Needed
rtOnceNo Other Parameters
rtHourlyEventInterval (Hours)
rtDailyEventInterval (Days)
rtWeeklyEventInterval (Weeks)
EventDays

Information The EventDays parameter specifies which days of the week to run on, with day 1 being Sunday and day 7 being Saturday. Just set the array index of the desired day to True to cause the event to run on that day.
rtMonthlyEventDayOfMonth
EventDayOfWeek
EventMonths

Information The EventDayOfMonth parameter specifies which day of the month to run on, a numbered day (1-31) or a specific day (Sunday-Saturday) of the 1st, 2nd, 3rd, or 4th week specified by the EventDayOfWeekParameter. The EventMonths parameter specifies which months of the year to run on, with month 1 being January and month 12 being December. Just set the array index of the desired month to True to cause the event to run on that month.

Information This method is only valid when the engine is running as a database server and the EngineType is set to etServer.
Image