Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running bcb5 app as NT service

Status
Not open for further replies.

maj12

Programmer
Nov 14, 2000
7
CA
Hey all,

I have a BCB5 app that I installed to run as a service in NT. The app queries a database every 60 seconds to see if there are any reports scheduled to be run. The app runs fine if started the usual way. The app will start from the services snapin but the problem is, when it is started this way, it gives me an error saying "Report Not Found". Here's the code to run when started as service:

//find out if Scheduler was started as Service or with -s param
if(ParamStr(1)!="")
{
//start timer and change display
bttnMainStop->Enabled = true;
bttnMainStart->Enabled = false;
Memo1->Lines->Add(FormatDateTime("mm/dd/yyyy hh:mm:ss", Now()) + " - Report Scheduler Started");
WriteLog(FormatDateTime("mm/dd/yyyy hh:mm:ss", Now()) + " - Report Scheduler Started");
timerQueryTimer(TfrmMain::bttnMainStart);
timerQuery->Enabled = true;
}

This starts the timer, which just queries the database to see if anything is due to run. If so, it runs the report. Like I said, when the timer is started manually (by pressing a button) it's fine, but when I use this code to automate it, I get this error "Report Not Found". Any ideas? Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top