|
-
Aug 29th, 2000, 06:43 AM
#1
Thread Starter
Lively Member
I have developed a VB program that access a database via ODBC and creates an Excel file as the result.
This program should run on an NT Server once a day started by the Scheduler.
How should the program comunicate to the outside how it works. Write in the Event log ? Should it be a services and pop up in the system tray ? Or both ?
If I sometime want to pass a parameter to the program how should I do that if it is a services ?
All suggestions needed , hopefully with program examples.
Yesterday, all my troubles seemed so far away...
Help, I need somebody, Help...
Now MCSD and still locking for intresting job in the south parts of Stockholm, Sweden.
-
Aug 29th, 2000, 06:55 AM
#2
Well if it's started bu the Scheduler it shouldn't be a service. Becuase that would mean that the Scheduler should start and stop that service once every day.
And since it runs on a server it shouldn't have a ny GUI at all. Writing to the NT event log sounds like a good idea. You can use the App.LogEvent method to do so.
If you want to pass arguments to the app you could simply design it to look for a text file in a predefined folder on startup. If the file exists it reads the file and uses the information as it would have been arguments passed to the application.
The app should then remove the file.
Best regards
-
Aug 29th, 2000, 07:21 AM
#3
Thread Starter
Lively Member
Thanks Joacim, I will use the App.LogEvent as a start.
It don't have to use the Scheduler but that seemd the easy solotuion but maybe a services would be better, I don't know.
Have anyone used services ?
Yesterday, all my troubles seemed so far away...
Help, I need somebody, Help...
Now MCSD and still locking for intresting job in the south parts of Stockholm, Sweden.
-
Aug 29th, 2000, 07:38 AM
#4
Yes I have a couple of times. Making a NT service using VB is somewhat compicated. Unless you download the NT Service Toolkit component from Desaware.
In your case however I think that making a NT Service is bit of a overkill because your app is only suppose to run once every day and not all the time.
-
Aug 29th, 2000, 08:26 AM
#5
Thread Starter
Lively Member
Event Viewer
Have do I change the source in the Event Viewer from VBRuntime to my program name ?
Yesterday, all my troubles seemed so far away...
Help, I need somebody, Help...
Now MCSD and still locking for intresting job in the south parts of Stockholm, Sweden.
-
Aug 30th, 2000, 12:51 AM
#6
Thread Starter
Lively Member
I dont get the LogEvent to log then I am in the IDE but the exe does it. Should it be like that ?
Yesterday, all my troubles seemed so far away...
Help, I need somebody, Help...
Now MCSD and still locking for intresting job in the south parts of Stockholm, Sweden.
-
Aug 30th, 2000, 04:27 AM
#7
Yupp! You can only logg the event when your app is compiled.
-
Aug 30th, 2000, 05:15 AM
#8
Thread Starter
Lively Member
Thanks Jocaim !
I got some help from another source so I now use
Private Declare Function ReportEvent Lib "advapi32.dll" Alias "ReportEventA" (ByVal hEventLog As Long, ByVal wType As Integer, ByVal wCategory As Integer, ByVal dwEventID As Long, ByVal lpUserSid As Any, ByVal wNumStrings As Integer, ByVal dwDataSize As Long, plpStrings As Long, lpRawData As Any) As Boolean
That make it possible to write events in the IDE and to set the source.
But I have not figured out how to use the dwEventID parameter or how to remove "The description for Event ID ( 1 ) in Source ( CosXFile_01 ) could not be found." text in the Event Viewer Detail.
Yesterday, all my troubles seemed so far away...
Help, I need somebody, Help...
Now MCSD and still locking for intresting job in the south parts of Stockholm, Sweden.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|