I've made a exe (Update.exe) file to update a record in a table via SQL statement.
I've made another program(update_service.exe) which runs as an admin service in windows.
When I run update.exe standalone it updates the record in the table. No errors. It works.
When update.exe is executed via update_service.exe it gives me a access violation:
Access violation at address 40006A2F in module 'rtl60.bpl'. Read of address 00000004.
The OS where the error occurs is W2003 server.
Delphi versie 6
Data access components: ADODB
It's a VCL app
On my local W7 PC everything works ok.
Code:
procedure TService1.tmr1Timer(Sender: TObject);
var
LclParams : string;
begin
if (FBusyUpgrading) or (UpgradeFileExists()) then
Exit;
if HourOfTheDay(Time) = HourOfTheDay(strToTime(FStartServiceTime)) then
if MinuteOfTheHour(Time) = MinuteOfTheHour(strToTime(FStartServiceTime)) then
begin
FBusyUpgrading := True;
WinExecAndWait32(IncludeTrailingBackslash(GetCurrentDir) + 'update.exe /START', SW_NORMAL);
FBusyUpgrading := False
end;
end;
How can I solve this problem?
FWIW: SQL statements for update:
sl.Add('UPDATE Licentie SET ExpiratieDatum=' + QuotedStr(LicenseKey.Expiratie) + ' WHERE Active=True')
(LicenseKey.Expiratie is an ordinary string)